Skip to content

Commit 9b51c40

Browse files
authored
Dev (#223)
* reduce conns testing * update * bring back count one for lock test * update * debug conns in ci * remove block test pool closing * use tags for skipping count one - broken negative regex * update tags * trying to refactor post migrations to use regular migrate * update and notes for handling single migration in parallel test suites * remove migration tables from gen * refactor * fix ci call * update * only run post migrations up in x.migrate * notes * rename countone tag tests for clarity * default ci env * default ci env * FIXME race condition in lock status check - require tx * dynamic go test flags - eg shuffle for ci only * test xo caching and attempt to use excludes * fixme * cache_all now handles exclusion regexes * fix arg parsing in cache_all when main process receives args * shuffle on ci * refactor * fix dumb driver swap * refactor migrate * notes * debug ci * update * using postgres test db for each test suite * ignore tracing test specific spans * leave full path for testutil postgres dbs * update * remove debug ci * update * fix cache_all * notes for fixed cleanpu * no exit cleanup with flag * increase ci testcount * use postgres_test for lock tests * refactor testutil newdb * migrations lock * fix * ntoes * ci not verbose * refactor * TODO - ignore constraints refactor * refactor * update * ignore line endings in vendor * ignoring constraints properly - pending restore of pagination when type is changed * notes * original type check for valid cursors * cleanup * notes * auto install apt * update * update * parallel typecheck exhaustruct * fix typo * vite host * udpate * bit of parallelism * cleanup * refactor * TODO - automated shorthand schema name gen e.g. RestUser - User * working on better rest gen * update * update * always generate all rest models * always generate rest models file * FIXME * always gen rest models replacing spec * clashes update * show line number for clashes * refactor * notes * crud gen update * fix data race * implement catch rest refs that dont exist for automatic generation * properly create arrays in go-utils * dont print ast-parser results if empty * easy caching of go bin tools * notes * refactor * FIXME xo tests * fix schema for xo tests gen * utils * use dedicated db for xo tests * notes * debug * debug * debug * debug * fix setup * trying to update ref gen * fixed automatic package gen * remove component schemas gen from crud generator - will autogenerate * fix ref schema gen when both missing * clean * shfmt * shell lint * sync * notes * use bare regex in place of ast-parser --create-generics-map * ignore force regen for install-tools and refactor frontend gen * speed up orval gen * remove msw references * notes * broken - try to output rest structs without Rest prefix directly and overwrite * update * gen without rest models * fix new rest gen
1 parent b823039 commit 9b51c40

File tree

221 files changed

+14393
-14168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+14393
-14168
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor/* -text

.github/actions/setup/action.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,20 @@ runs:
4545
restore-keys: |
4646
${{ runner.os }}-pnpm-store-
4747
48+
- name: Update
49+
shell: bash
50+
run: |
51+
sudo apt-get update
52+
4853
- name: Install dependencies
4954
shell: bash
5055
run: |
5156
source .envrc
5257
53-
sudo apt-get update
54-
55-
{ yes || :; } | project bootstrap --x-env=ci
58+
echo Bootstrapping...
59+
{ yes y 2>/dev/null || :; } | project bootstrap --x-debug
5660
57-
# project e2e.sync-deps --x-env=ci # won't use python playwright
61+
# project e2e.sync-deps # won't use python playwright
5862
5963
echo "$HOME/.local/bin" >> $GITHUB_PATH
6064
echo "$HOME/bin" >> $GITHUB_PATH

.github/workflows/openapi-check.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: OpenAPI check
2-
2+
env:
3+
CI: true
34
on:
45
push:
56
branches:

.github/workflows/tests.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Tests
2-
2+
env:
3+
CI: true
34
on:
45
push:
56
branches:
@@ -29,9 +30,9 @@ jobs:
2930
# go mod download # it will access network/cache, which is not necessary with -mod=vendor
3031
go mod verify
3132
32-
project test.backend.setup --x-env=ci
33+
project test.backend.setup
3334
34-
project lint --x-env=ci
35+
project lint
3536
3637
- name: Diff check
3738
run: |
@@ -42,13 +43,21 @@ jobs:
4243
run: |
4344
source .envrc
4445
46+
{
47+
while sleep 1; do project db.conns-db postgres_test --x-no-exit-cleanup; done
48+
} &
49+
bg_pid=$!
50+
4551
echo -------1-------
46-
POSTGRES_TRACE=false project test.create-crud-gen -v --x-env=ci
52+
POSTGRES_TRACE=false project test.create-crud-gen --x-debug
4753
echo -------2-------
48-
POSTGRES_TRACE=false project test.backend -v -race -count=30 -timeout=40m --x-env=ci
54+
POSTGRES_TRACE=false project test.backend -race -count=50 -timeout=40m
4955
echo -------3-------
5056
# some tests are skipped from race
51-
POSTGRES_TRACE=false project test.backend -v -count=3 -timeout=40m --x-env=ci
57+
POSTGRES_TRACE=false project test.backend -count=3 -timeout=40m
58+
59+
{ test -n "$bg_pid" && kill $bg_pid; } || true
60+
5261
5362
- name: Postgres logs
5463
if: failure() # always()
@@ -58,13 +67,13 @@ jobs:
5867
run: |
5968
source .envrc
6069
61-
project test.frontend --x-env=ci
70+
project test.frontend
6271
6372
- name: Test E2E
6473
run: |
6574
source .envrc
6675
67-
project e2e.run --x-env=ci
76+
project e2e.run
6877
6978
- uses: actions/upload-artifact@v3
7079
if: always()

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"-count=1",
1313
"-v"
1414
],
15+
// "go.testEnvFile": null,
1516
// --
1617
"shellcheck.executablePath": "shellcheck",
1718
"shellcheck.customArgs": [
@@ -74,7 +75,7 @@
7475
"db/migrations/*.down.sql"
7576
],
7677
"postMigrationFiles": [
77-
"db/post-migration/*.sql"
78+
"db/post-migrations/*.sql"
7879
],
7980
"target": "all",
8081
},

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,33 @@ Fill in `.env.template`'s:
8484
find . -name ".env*.template"
8585
```
8686

87+
For `dev` environment, you may use `env.ci` as a starting point,
88+
replacing `ci` with `dev` and using `API_PREFIX=""` since it will run
89+
the backend without docker containers.
90+
8791
Assuming a recent Ubuntu release:
8892

8993
```bash
9094

91-
sudo apt install direnv
95+
sudo apt install direnv -y
9296
direnv allow # you can also customize direnv with .envrc.local as you would a regular .envrc, see example
9397

9498
cp openapi-go.code-workspace.example openapi-go.code-workspace # edit as desired
9599

96100
project bootstrap # dependency and tools interactive installation
97101
project gen
102+
project recreate-shared-services
98103
project run-dev
99104
```
100105

106+
For first test run:
107+
108+
```bash
109+
project test.backend.setup
110+
project test.backend
111+
project test.frontend
112+
```
113+
101114
### Tracing, monitoring...
102115

103116
```bash

0 commit comments

Comments
 (0)