From b5c84dd84df0d727ff34088b0793a0de61822d46 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 18:09:36 +0100 Subject: [PATCH 01/29] infra: integration test via github action --- .github/workflows/postgres-test.yml | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/postgres-test.yml diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml new file mode 100644 index 00000000..cbb02e7c --- /dev/null +++ b/.github/workflows/postgres-test.yml @@ -0,0 +1,61 @@ +name: Postgres Test + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + integration-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:9.6-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + name: 'Postgres Test: pg-9.6, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: pnpm run migrate up -- -m test/migrations && pnpm run migrate down 0 -- -m test/migrations --timestamps + env: + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test From a61e747f080462b7aeabded4e7eeb315243bfda2 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 18:14:10 +0100 Subject: [PATCH 02/29] connect to service --- .github/workflows/postgres-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index cbb02e7c..dce5a6b5 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -58,4 +58,4 @@ jobs: - name: Integration Test run: pnpm run migrate up -- -m test/migrations && pnpm run migrate down 0 -- -m test/migrations --timestamps env: - DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test + DATABASE_URL: postgres://ubuntu:ubuntu@postgres:5432/integration_test From 66b3ace8ff88f14149670c8b4327613ea7109f3e Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 18:16:33 +0100 Subject: [PATCH 03/29] map port to host --- .github/workflows/postgres-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index dce5a6b5..55b97162 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -31,6 +31,9 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 name: 'Postgres Test: pg-9.6, node-${{ matrix.node_version }}, ubuntu-latest' steps: @@ -58,4 +61,4 @@ jobs: - name: Integration Test run: pnpm run migrate up -- -m test/migrations && pnpm run migrate down 0 -- -m test/migrations --timestamps env: - DATABASE_URL: postgres://ubuntu:ubuntu@postgres:5432/integration_test + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test From 3430dfc0eddc24ddba5854bf0983a18dffbb9bf0 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 18:18:31 +0100 Subject: [PATCH 04/29] try remove -- --- .github/workflows/postgres-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index 55b97162..66e5517b 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -59,6 +59,6 @@ jobs: run: pnpm run build - name: Integration Test - run: pnpm run migrate up -- -m test/migrations && pnpm run migrate down 0 -- -m test/migrations --timestamps + run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps env: DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test From d507a1364c211c71992486523c2def0920d2442a Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 18:31:33 +0100 Subject: [PATCH 05/29] use matrix for postgres version --- .github/workflows/postgres-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index 66e5517b..f75bdd58 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -15,12 +15,13 @@ jobs: strategy: matrix: node_version: [20] + postgres_version: [9.6, 10.23, 11.22, 12.18, 13.14, 14.11] fail-fast: false timeout-minutes: 10 services: postgres: - image: postgres:9.6-alpine + image: postgres:${{ matrix.postgres_version }}-alpine env: POSTGRES_USER: ubuntu POSTGRES_PASSWORD: ubuntu @@ -35,7 +36,7 @@ jobs: # Maps tcp port 5432 on service container to the host - 5432:5432 - name: 'Postgres Test: pg-9.6, node-${{ matrix.node_version }}, ubuntu-latest' + name: 'Postgres Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From b4245d6b312272992d1ae793114f5eec6170845c Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 18:57:52 +0100 Subject: [PATCH 06/29] add cockroach test --- .circleci/config.yml | 170 --------------------------- .github/workflows/cockroach-test.yml | 62 ++++++++++ .github/workflows/postgres-test.yml | 2 +- 3 files changed, 63 insertions(+), 171 deletions(-) create mode 100644 .github/workflows/cockroach-test.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 7dee2fd1..5afa50d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,90 +62,6 @@ jobs: paths: - ./node_modules - <<: *save - test-pg-9: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:9.6-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-pg-10: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:10.19-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-pg-11: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:11.14-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-pg-12: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:12.9-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-pg-13: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:13.5-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-pg-14: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres test-cockroach-1: docker: - <<: *node-image @@ -211,62 +127,6 @@ jobs: - run: name: test command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps - test-node-12: - docker: - - image: circleci/node:12.20.0 - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-node-14: - docker: - - image: circleci/node:14 - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-node-16: - docker: - - image: circleci/node:16 - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-node-17: - docker: - - image: circleci/node:17 - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:13.5-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres test-config: docker: - <<: *node-image @@ -513,24 +373,6 @@ workflows: main_workflow: jobs: - install - - test-pg-9: - requires: - - install - - test-pg-10: - requires: - - install - - test-pg-11: - requires: - - install - - test-pg-12: - requires: - - install - - test-pg-13: - requires: - - install - - test-pg-14: - requires: - - install - test-cockroach-1: requires: - install @@ -546,18 +388,6 @@ workflows: - test-cockroach-21: requires: - install - - test-node-12: - requires: - - install - - test-node-14: - requires: - - install - - test-node-16: - requires: - - install - - test-node-17: - requires: - - install - test-config: requires: - install diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml new file mode 100644 index 00000000..0ecd6068 --- /dev/null +++ b/.github/workflows/cockroach-test.yml @@ -0,0 +1,62 @@ +name: Cockroach Test + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + integration-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + cockroach_version: [19.2.12] + fail-fast: false + timeout-minutes: 10 + + services: + cockroach: + image: cockroachdb/cockroach:v${{ matrix.cockroach_version }} + env: + DATABASE_URL: postgresql://root@localhost:26257/integration_test + # Set health checks to wait until cockroach has started + options: >- + start + --insecure + --host=localhost + ports: + # Maps tcp port 26257 on service container to the host + - 26257:26257 + + name: 'Cockroach Test: cockroach-${{ matrix.cockroach_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: pnpm run migrate up -m test/cockroach --no-lock && pnpm run migrate down 0 -m test/cockroach --no-lock --timestamps + env: + DATABASE_URL: postgresql://root@localhost:26257/integration_test diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index f75bdd58..ad86ed34 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node_version: [20] + node_version: [18, 20] postgres_version: [9.6, 10.23, 11.22, 12.18, 13.14, 14.11] fail-fast: false timeout-minutes: 10 From 733c071b1ce617f7f33ef6e636f9e2dede2ed7aa Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 18:59:59 +0100 Subject: [PATCH 07/29] remove options --- .github/workflows/cockroach-test.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 0ecd6068..800aef53 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -24,11 +24,6 @@ jobs: image: cockroachdb/cockroach:v${{ matrix.cockroach_version }} env: DATABASE_URL: postgresql://root@localhost:26257/integration_test - # Set health checks to wait until cockroach has started - options: >- - start - --insecure - --host=localhost ports: # Maps tcp port 26257 on service container to the host - 26257:26257 From 0a7c2670c07ec0a9efffda086d5dca97cb895727 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:11:59 +0100 Subject: [PATCH 08/29] init db --- .github/workflows/cockroach-test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 800aef53..877d0e0f 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -24,6 +24,12 @@ jobs: image: cockroachdb/cockroach:v${{ matrix.cockroach_version }} env: DATABASE_URL: postgresql://root@localhost:26257/integration_test + # Set health checks to wait until cockroach has started + options: >- + --health-cmd "cockroach node status --insecure" + --health-interval 10s + --health-timeout 5s + --health-retries 5 ports: # Maps tcp port 26257 on service container to the host - 26257:26257 @@ -51,6 +57,16 @@ jobs: - name: Build run: pnpm run build + - name: Init Cockroach + run: | + dockerize -wait tcp://127.0.0.1:26257 -timeout 60s && node -e ' + (new (require("pg").Pool)({ connectionString: process.env.DATABASE_URL })) + .query( + "CREATE DATABASE integration_test", + err => (process.exitCode = err ? 1 : 0) && process.stdout.write(err.stack) + ) + ' + - name: Integration Test run: pnpm run migrate up -m test/cockroach --no-lock && pnpm run migrate down 0 -m test/cockroach --no-lock --timestamps env: From 47bb13e5da2d4b8ad9e90dd4f43d262e3bdbe43b Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:13:58 +0100 Subject: [PATCH 09/29] try command --- .github/workflows/cockroach-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 877d0e0f..553b24a1 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -26,7 +26,7 @@ jobs: DATABASE_URL: postgresql://root@localhost:26257/integration_test # Set health checks to wait until cockroach has started options: >- - --health-cmd "cockroach node status --insecure" + --health-cmd "start --insecure --host=localhost" --health-interval 10s --health-timeout 5s --health-retries 5 From a3f08a4e0b4224183d9cdd9a8fe3bb56e82b3434 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:15:45 +0100 Subject: [PATCH 10/29] try command --- .github/workflows/cockroach-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 553b24a1..99004680 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -26,7 +26,7 @@ jobs: DATABASE_URL: postgresql://root@localhost:26257/integration_test # Set health checks to wait until cockroach has started options: >- - --health-cmd "start --insecure --host=localhost" + --health-cmd "cockroach start --insecure --host=localhost" --health-interval 10s --health-timeout 5s --health-retries 5 From 1952ab453ad4626cadf1de70678e9c3dfa118db7 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:26:59 +0100 Subject: [PATCH 11/29] try manual docker --- .github/workflows/cockroach-test.yml | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 99004680..129620be 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -19,21 +19,6 @@ jobs: fail-fast: false timeout-minutes: 10 - services: - cockroach: - image: cockroachdb/cockroach:v${{ matrix.cockroach_version }} - env: - DATABASE_URL: postgresql://root@localhost:26257/integration_test - # Set health checks to wait until cockroach has started - options: >- - --health-cmd "cockroach start --insecure --host=localhost" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps tcp port 26257 on service container to the host - - 26257:26257 - name: 'Cockroach Test: cockroach-${{ matrix.cockroach_version }}, node-${{ matrix.node_version }}, ubuntu-latest' steps: - name: Checkout @@ -59,13 +44,9 @@ jobs: - name: Init Cockroach run: | - dockerize -wait tcp://127.0.0.1:26257 -timeout 60s && node -e ' - (new (require("pg").Pool)({ connectionString: process.env.DATABASE_URL })) - .query( - "CREATE DATABASE integration_test", - err => (process.exitCode = err ? 1 : 0) && process.stdout.write(err.stack) - ) - ' + docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }} + docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start --insecure + docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | cockroach sql --insecure" - name: Integration Test run: pnpm run migrate up -m test/cockroach --no-lock && pnpm run migrate down 0 -m test/cockroach --no-lock --timestamps From f5188f369ce73b7a03f62f9217c3ffd4b20a4b42 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:29:00 +0100 Subject: [PATCH 12/29] add dockerize wait --- .github/workflows/cockroach-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 129620be..03924f57 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -46,6 +46,7 @@ jobs: run: | docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }} docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start --insecure + dockerize -wait tcp://127.0.0.1:26257 -timeout 60s docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | cockroach sql --insecure" - name: Integration Test From 68a3614a54496ff0da27ee644d0f5176c42ff76f Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:30:24 +0100 Subject: [PATCH 13/29] try wait-for-it --- .github/workflows/cockroach-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 03924f57..78f71d73 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -46,7 +46,8 @@ jobs: run: | docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }} docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start --insecure - dockerize -wait tcp://127.0.0.1:26257 -timeout 60s + sudo apt update && sudo apt install wait-for-it -y + wait-for-it -h localhost -p 26257 docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | cockroach sql --insecure" - name: Integration Test From 2405db06fd097d589ad9f985223dbeabbf8cae85 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:35:35 +0100 Subject: [PATCH 14/29] try start-single-node --- .github/workflows/cockroach-test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 78f71d73..975395aa 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -21,6 +21,14 @@ jobs: name: 'Cockroach Test: cockroach-${{ matrix.cockroach_version }}, node-${{ matrix.node_version }}, ubuntu-latest' steps: + - name: Init Cockroach + run: | + docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }} + docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start-single-node --insecure + sudo apt update && sudo apt install wait-for-it -y + wait-for-it -h localhost -p 26257 + docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | cockroach sql --insecure" + - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: @@ -42,14 +50,6 @@ jobs: - name: Build run: pnpm run build - - name: Init Cockroach - run: | - docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }} - docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start --insecure - sudo apt update && sudo apt install wait-for-it -y - wait-for-it -h localhost -p 26257 - docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | cockroach sql --insecure" - - name: Integration Test run: pnpm run migrate up -m test/cockroach --no-lock && pnpm run migrate down 0 -m test/cockroach --no-lock --timestamps env: From 070594bdd401ed34bf8bd05b64c76229af147182 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:37:52 +0100 Subject: [PATCH 15/29] try CONTAINER_ENTRYPOINT env --- .github/workflows/cockroach-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 975395aa..4f6d1109 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -22,12 +22,15 @@ jobs: name: 'Cockroach Test: cockroach-${{ matrix.cockroach_version }}, node-${{ matrix.node_version }}, ubuntu-latest' steps: - name: Init Cockroach + env: + CONTAINER_ENTRYPOINT: ${{ 'cockroach' }} run: | + echo $CONTAINER_ENTRYPOINT docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }} docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start-single-node --insecure sudo apt update && sudo apt install wait-for-it -y wait-for-it -h localhost -p 26257 - docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | cockroach sql --insecure" + docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | $CONTAINER_ENTRYPOINT sql --insecure" - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 02e6a298677219740ade223a05aeadacb190d008 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:49:12 +0100 Subject: [PATCH 16/29] try sql execute --- .github/workflows/cockroach-test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 4f6d1109..b1e047c5 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -23,14 +23,16 @@ jobs: steps: - name: Init Cockroach env: + COCKROACHDB_DOCKER_TAG: cockroachdb/cockroach:v${{ matrix.cockroach_version }} CONTAINER_ENTRYPOINT: ${{ 'cockroach' }} + DATABASE_URL: postgresql://root@localhost:26257/integration_test run: | echo $CONTAINER_ENTRYPOINT - docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }} - docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start-single-node --insecure + docker pull $COCKROACHDB_DOCKER_TAG + docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 $COCKROACHDB_DOCKER_TAG start-single-node --insecure sudo apt update && sudo apt install wait-for-it -y wait-for-it -h localhost -p 26257 - docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | $CONTAINER_ENTRYPOINT sql --insecure" + docker exec roach bash -c "cockroach sql --execute=\"CREATE DATABASE integration_test;\" --insecure" - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From a0e9c14b732fe8c33436f446c65f4173e74a5edc Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:50:56 +0100 Subject: [PATCH 17/29] try add github.workspace /app --- .github/workflows/cockroach-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index b1e047c5..5d547ba3 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -29,7 +29,7 @@ jobs: run: | echo $CONTAINER_ENTRYPOINT docker pull $COCKROACHDB_DOCKER_TAG - docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 $COCKROACHDB_DOCKER_TAG start-single-node --insecure + docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 -v "${{ github.workspace }}:/app" $COCKROACHDB_DOCKER_TAG start-single-node --insecure sudo apt update && sudo apt install wait-for-it -y wait-for-it -h localhost -p 26257 docker exec roach bash -c "cockroach sql --execute=\"CREATE DATABASE integration_test;\" --insecure" From 02de1c35f561cd8aa6b335124ce1df290d1e598b Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 19:58:00 +0100 Subject: [PATCH 18/29] disable docker exec --- .github/workflows/cockroach-test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 5d547ba3..85098c8b 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -24,15 +24,13 @@ jobs: - name: Init Cockroach env: COCKROACHDB_DOCKER_TAG: cockroachdb/cockroach:v${{ matrix.cockroach_version }} - CONTAINER_ENTRYPOINT: ${{ 'cockroach' }} DATABASE_URL: postgresql://root@localhost:26257/integration_test run: | - echo $CONTAINER_ENTRYPOINT docker pull $COCKROACHDB_DOCKER_TAG - docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 -v "${{ github.workspace }}:/app" $COCKROACHDB_DOCKER_TAG start-single-node --insecure + docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 $COCKROACHDB_DOCKER_TAG start-single-node --insecure sudo apt update && sudo apt install wait-for-it -y wait-for-it -h localhost -p 26257 - docker exec roach bash -c "cockroach sql --execute=\"CREATE DATABASE integration_test;\" --insecure" + # docker exec roach bash -c "cockroach sql --execute=\"CREATE DATABASE integration_test;\" --insecure" - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 446d0fb2e6c806b53c52c79df242ca6aac33059b Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 21:02:16 +0100 Subject: [PATCH 19/29] try relative command --- .github/workflows/cockroach-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 85098c8b..544d8e98 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -30,7 +30,7 @@ jobs: docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 $COCKROACHDB_DOCKER_TAG start-single-node --insecure sudo apt update && sudo apt install wait-for-it -y wait-for-it -h localhost -p 26257 - # docker exec roach bash -c "cockroach sql --execute=\"CREATE DATABASE integration_test;\" --insecure" + docker exec roach bash -c "./cockroach sql --execute=\"CREATE DATABASE integration_test;\" --insecure" - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 049ae3d87c10394a1641d871dabf28b3159d09c7 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 21:51:16 +0100 Subject: [PATCH 20/29] add more cockroach --- .github/workflows/cockroach-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 544d8e98..de7743f7 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: node_version: [20] - cockroach_version: [19.2.12] + cockroach_version: [1.1.9, 2.1.11, 19.2.12, 20.2.19, 21.2.17, 22.2.19, 23.1.16] fail-fast: false timeout-minutes: 10 From 8700798afbef1ff241620a6214134d9370c75a15 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 21:52:47 +0100 Subject: [PATCH 21/29] remove circleci cockroach --- .circleci/config.yml | 92 -------------------------------------------- 1 file changed, 92 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5afa50d5..69866520 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,18 +35,6 @@ test-postgres: &test-postgres name: test command: npm run migrate up -- -m test/migrations && npm run migrate down 0 -- -m test/migrations --timestamps -cockroach-wait: &cockroach-wait - run: - name: Wait for DB - command: | - dockerize -wait tcp://127.0.0.1:26257 -timeout 120s && node -e ' - (new (require("pg").Pool)({ connectionString: process.env.DATABASE_URL })) - .query( - "CREATE DATABASE circle_test", - err => (process.exitCode = err ? 1 : 0) && process.stdout.write(err.stack) - ) - ' - jobs: install: docker: @@ -62,71 +50,6 @@ jobs: paths: - ./node_modules - <<: *save - test-cockroach-1: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgresql://root@localhost:26257/circle_test - - image: cockroachdb/cockroach:v1.1.9 - command: ['start', '--insecure', '--host=localhost'] - steps: - - <<: *restore - - <<: *cockroach-wait - - run: - name: test - command: npm run migrate up -- -m test/cockroach -s '' --migrations-schema circle_test --no-lock && npm run migrate down 0 -- -m test/cockroach -s '' --migrations-schema circle_test --no-lock --timestamps - test-cockroach-2: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgresql://root@localhost:26257/circle_test - - image: cockroachdb/cockroach:v2.1.11 - command: ['start', '--insecure', '--host=localhost'] - steps: - - <<: *restore - - <<: *cockroach-wait - - run: - name: test - command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps - test-cockroach-19: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgresql://root@localhost:26257/circle_test - - image: cockroachdb/cockroach:v19.2.12 - command: ['start', '--insecure', '--host=localhost'] - steps: - - <<: *restore - - <<: *cockroach-wait - - run: - name: test - command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps - test-cockroach-20: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgresql://root@localhost:26257/circle_test - - image: cockroachdb/cockroach:v20.2.18 - command: ['start-single-node', '--insecure', '--host=localhost'] - steps: - - <<: *restore - - <<: *cockroach-wait - - run: - name: test - command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps - test-cockroach-21: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgresql://root@localhost:26257/circle_test - - image: cockroachdb/cockroach:v21.2.3 - command: ['start-single-node', '--insecure', '--host=localhost'] - steps: - - <<: *restore - - <<: *cockroach-wait - - run: - name: test - command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps test-config: docker: - <<: *node-image @@ -373,21 +296,6 @@ workflows: main_workflow: jobs: - install - - test-cockroach-1: - requires: - - install - - test-cockroach-2: - requires: - - install - - test-cockroach-19: - requires: - - install - - test-cockroach-20: - requires: - - install - - test-cockroach-21: - requires: - - install - test-config: requires: - install From 6fa91ee1abe1447dd89ee5c3fcedeeea3d6b548a Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 21:56:31 +0100 Subject: [PATCH 22/29] remove deprecated dbs and add new dbs --- .github/workflows/cockroach-test.yml | 2 +- .github/workflows/postgres-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index de7743f7..1b71852a 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: node_version: [20] - cockroach_version: [1.1.9, 2.1.11, 19.2.12, 20.2.19, 21.2.17, 22.2.19, 23.1.16] + cockroach_version: [22.2.19, 23.1.16] fail-fast: false timeout-minutes: 10 diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index ad86ed34..21dc7a79 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: node_version: [18, 20] - postgres_version: [9.6, 10.23, 11.22, 12.18, 13.14, 14.11] + postgres_version: [12.18, 13.14, 14.11, 15.6, 16.2] fail-fast: false timeout-minutes: 10 From 4b8d6f8ffc4926a0f4585d5f281f57fe20bcf8ec Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 22:27:42 +0100 Subject: [PATCH 23/29] migrate rest of the tests --- .circleci/config.yml | 337 -------------- .github/workflows/ci.yml | 42 ++ .github/workflows/postgres-test.yml | 693 +++++++++++++++++++++++++++- 3 files changed, 734 insertions(+), 338 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 69866520..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,337 +0,0 @@ -version: 2 - -node-image: &node-image - image: circleci/node:17 - -set-npm-global: &set-npm-global - run: - name: set-npm-global - command: | - mkdir -p ~/.npm-global - npm config set prefix '~/.npm-global' - echo 'export NPM_CONFIG_PREFIX=~/.npm-global' >> $BASH_ENV - echo 'export PATH=~/.npm-global/bin:$PATH' >> $BASH_ENV - source $BASH_ENV - npm install -g pnpm - -save: &save - save_cache: - key: code-{{ .Revision }} - paths: - - . - - '~/.npm-global' - -restore: &restore - restore_cache: - key: code-{{ .Revision }} - -postgres-wait: &postgres-wait - run: - name: Wait for DB - command: dockerize -wait tcp://127.0.0.1:5432 -timeout 120s - -test-postgres: &test-postgres - run: - name: test - command: npm run migrate up -- -m test/migrations && npm run migrate down 0 -- -m test/migrations --timestamps - -jobs: - install: - docker: - - <<: *node-image - steps: - - checkout - - <<: *set-npm-global - - restore_cache: - key: dependency-cache-{{ checksum "pnpm-lock.yaml" }} - - run: npm i - - save_cache: - key: dependency-cache-{{ checksum "pnpm-lock.yaml" }} - paths: - - ./node_modules - - <<: *save - test-config: - docker: - - <<: *node-image - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - run: - name: create-config - command: | - mkdir -p config - cat > config/default.json << 'EOF' - { - "db": { - "user": "ubuntu", - "password": "ubuntu", - "host": "localhost", - "port": "5432", - "database": "circle_test" - } - } - EOF - - <<: *postgres-wait - - <<: *test-postgres - test-dotenv: - docker: - - <<: *node-image - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - run: - name: create-config - command: | - cat > .env << 'EOF' - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - EOF - - <<: *postgres-wait - - <<: *test-postgres - test-dotenv-expand: - docker: - - <<: *node-image - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - run: - name: create-config - command: | - cat > .env << 'EOF' - POSTGRES_USER=ubuntu - POSTGRES_PASSWORD=ubuntu - POSTGRES_DB=circle_test - DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB - EOF - - <<: *postgres-wait - - <<: *test-postgres - test-password-1: - docker: - - <<: *node-image - environment: - # can't use characters @#?/ in password - they have special meaning in url - - DATABASE_URL=postgres://ubuntu:123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\ - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-password-2: - docker: - - <<: *node-image - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - run: - name: create-config - command: | - mkdir -p config - cat > config/default.json << 'EOF' - { - "db": { - "user": "ubuntu", - "password": "123456abcdefghABCDEFGH~`!@#$%^&*-_=+{}[]()<>,.;:\"'?|/\\", - "host": "localhost", - "port": "5432", - "database": "circle_test" - } - } - EOF - - <<: *postgres-wait - - <<: *test-postgres - test-env-vars: - docker: - - <<: *node-image - environment: - - PGUSER=ubuntu - - PGPASSWORD=123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ - - PGDATABASE=circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - <<: *test-postgres - test-schema: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - # used in tests - - SCHEMA=myschema - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - run: - name: test - command: npm run migrate up -- -s myschema --create-schema -m test/migrations && npm run migrate down 0 -- -s myschema -m test/migrations --timestamps - test-schemas: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - # used in tests - - SCHEMA=myschema - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - run: - name: test - command: npm run migrate up -- -s myschema public --create-schema -m test/migrations && npm run migrate down 0 -- -s myschema public -m test/migrations --timestamps - test-typescript-migration: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - run: - name: test - command: npm run migrate up -- --tsconfig tsconfig.json -m test/ts/migrations && npm run migrate down 0 -- --tsconfig tsconfig.json -m test/ts/migrations --timestamps - test-typescript-customrunner-url: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - run: - name: test - command: $(npm bin)/ts-node test/ts/customRunnerDBUrl.ts - test-typescript-customrunner-client: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - run: - name: test - command: $(npm bin)/ts-node test/ts/customRunnerDBClient.ts - test-typescript-customrunner-undef-count: - docker: - - <<: *node-image - environment: - - DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test - - image: postgres:14.1-alpine - environment: - - POSTGRES_USER=ubuntu - - POSTGRES_PASSWORD=ubuntu - - POSTGRES_DB=circle_test - steps: - - <<: *restore - - <<: *postgres-wait - - run: - name: test - command: $(npm bin)/ts-node test/ts/customRunnerUndefCount.ts - test-create-migration: - docker: - - <<: *node-image - steps: - - <<: *restore - - run: - name: check dir does not exists - command: | - [ ! -d migrations ] - - run: - name: create migration - command: npm run migrate create test - - run: - name: check file was created - command: | - [ $(ls -1 migrations | wc -l) -eq 1 ] - -workflows: - version: 2 - main_workflow: - jobs: - - install - - test-config: - requires: - - install - - test-dotenv: - requires: - - install - - test-dotenv-expand: - requires: - - install - - test-password-1: - requires: - - install - - test-password-2: - requires: - - install - - test-env-vars: - requires: - - install - - test-schema: - requires: - - install - - test-schemas: - requires: - - install - - test-typescript-migration: - requires: - - install - - test-typescript-customrunner-url: - requires: - - install - - test-typescript-customrunner-client: - requires: - - install - - test-typescript-customrunner-undef-count: - requires: - - install - - test-create-migration: - requires: - - install diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 541b31b3..87d28f03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,3 +72,45 @@ jobs: - name: Check formatting run: pnpm prettier --check . + + create-migration-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + fail-fast: false + timeout-minutes: 10 + + name: 'Create Migration Test: node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Check dir does not exists + run: | + [ ! -d migrations ] + + - name: Create migration + run: pnpm run migrate create test + + - name: Check file was created + run: | + [ $(ls -1 migrations | wc -l) -eq 1 ] diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index 21dc7a79..f5e1f0f6 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -10,7 +10,7 @@ permissions: contents: read # to fetch code (actions/checkout) jobs: - integration-test: + migration-test: runs-on: ubuntu-latest strategy: matrix: @@ -63,3 +63,694 @@ jobs: run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps env: DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test + + config-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Config Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Write config + run: | + mkdir -p config + cat > config/default.json << 'EOF' + { + "db": { + "user": "ubuntu", + "password": "ubuntu", + "host": "localhost", + "port": "5432", + "database": "integration_test" + } + } + EOF + + - name: Integration Test + run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps + + dotenv-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Dotenv Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Write config + run: | + cat > .env << 'EOF' + DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/integration_test + EOF + + - name: Integration Test + run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps + + dotenv-expand-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Dotenv Expand Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Write config + run: | + cat > .env << 'EOF' + POSTGRES_USER=ubuntu + POSTGRES_PASSWORD=ubuntu + POSTGRES_DB=integration_test + DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB + EOF + + - name: Integration Test + run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps + + password-1-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\ + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Password 1 Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\ + POSTGRES_DB: integration_test + + password-2-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Password 2 Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Write config + run: | + mkdir -p config + cat > config/default.json << 'EOF' + { + "db": { + "user": "ubuntu", + "password": "123456abcdefghABCDEFGH~`!@#$%^&*-_=+{}[]()<>,.;:\"'?|/\\", + "host": "localhost", + "port": "5432", + "database": "integration_test" + } + } + EOF + + - name: Integration Test + run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps + + env-vars-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Env Vars Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps + env: + PGUSER: ubuntu + PGPASSWORD: 123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ + PGDATABASE: integration_test + + schema-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Schema Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: pnpm run migrate up -s myschema --create-schema -m test/migrations && pnpm run migrate down 0 -s myschema -m test/migrations --timestamps + env: + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test + SCHEMA: myschema + + schemas-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'Schemas Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: pnpm run migrate up -s myschema public --create-schema -m test/migrations && pnpm run migrate down 0 -s myschema public -m test/migrations --timestamps + env: + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test + SCHEMA: myschema + + typescript-migration-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'TypeScript Migration Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: pnpm run migrate up --tsconfig tsconfig.json -m test/ts/migrations && pnpm run migrate down 0 --tsconfig tsconfig.json -m test/ts/migrations --timestamps + env: + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test + + typescript-customrunner-url-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'TypeScript Customrunner Url Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: $(npm bin)/ts-node test/ts/customRunnerDBUrl.ts + env: + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test + + typescript-customrunner-client-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'TypeScript Customrunner Client Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: $(npm bin)/ts-node test/ts/customRunnerDBClient.ts + env: + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test + + typescript-customrunner-undef-count-test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [20] + postgres_version: [16.2] + fail-fast: false + timeout-minutes: 10 + + services: + postgres: + image: postgres:${{ matrix.postgres_version }}-alpine + env: + POSTGRES_USER: ubuntu + POSTGRES_PASSWORD: ubuntu + POSTGRES_DB: integration_test + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + name: 'TypeScript Customrunner undef count Test: pg-${{ matrix.postgres_version }}, node-${{ matrix.node_version }}, ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + # Required for docs/versions tests + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: ${{ matrix.node_version }} + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Integration Test + run: $(npm bin)/ts-node test/ts/customRunnerUndefCount.ts + env: + DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test From ceccd6f7deb02490ed71591c48a864c4eaf8de8b Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 22:36:58 +0100 Subject: [PATCH 24/29] fix some tests --- .github/workflows/postgres-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index f5e1f0f6..122a8ab2 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -264,6 +264,7 @@ jobs: image: postgres:${{ matrix.postgres_version }}-alpine env: POSTGRES_USER: ubuntu + # can't use characters @#?/ in password - they have special meaning in url POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\ POSTGRES_DB: integration_test # Set health checks to wait until postgres has started @@ -302,9 +303,7 @@ jobs: - name: Integration Test run: pnpm run migrate up -m test/migrations && pnpm run migrate down 0 -m test/migrations --timestamps env: - POSTGRES_USER: ubuntu - POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\ - POSTGRES_DB: integration_test + DATABASE_URL: postgres://ubuntu:123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\@localhost:5432/integration_test password-2-test: runs-on: ubuntu-latest @@ -320,6 +319,7 @@ jobs: image: postgres:${{ matrix.postgres_version }}-alpine env: POSTGRES_USER: ubuntu + # can't use characters @#?/ in password - they have special meaning in url POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ POSTGRES_DB: integration_test # Set health checks to wait until postgres has started @@ -643,7 +643,7 @@ jobs: run: pnpm run build - name: Integration Test - run: $(npm bin)/ts-node test/ts/customRunnerDBUrl.ts + run: pnpm ts-node test/ts/customRunnerDBUrl.ts env: DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test @@ -697,7 +697,7 @@ jobs: run: pnpm run build - name: Integration Test - run: $(npm bin)/ts-node test/ts/customRunnerDBClient.ts + run: pnpm ts-node test/ts/customRunnerDBClient.ts env: DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test @@ -751,6 +751,6 @@ jobs: run: pnpm run build - name: Integration Test - run: $(npm bin)/ts-node test/ts/customRunnerUndefCount.ts + run: pnpm ts-node test/ts/customRunnerUndefCount.ts env: DATABASE_URL: postgres://ubuntu:ubuntu@localhost:5432/integration_test From 884b7242c52e6b8448f45bac45f6d4ce171357b9 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 22:49:15 +0100 Subject: [PATCH 25/29] fix pw --- .github/workflows/postgres-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index 122a8ab2..6d65abe7 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -319,8 +319,7 @@ jobs: image: postgres:${{ matrix.postgres_version }}-alpine env: POSTGRES_USER: ubuntu - # can't use characters @#?/ in password - they have special meaning in url - POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!@#$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'?\|/\\ + POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~`!@#$%^&*-_=+{}[]()<>,.;:\"'?|/\\ POSTGRES_DB: integration_test # Set health checks to wait until postgres has started options: >- From e7fa35317f6cd062d51c8a2668951ef372e79f14 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 22:52:10 +0100 Subject: [PATCH 26/29] try fix pw --- .github/workflows/postgres-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index 6d65abe7..8b2754ab 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -319,7 +319,7 @@ jobs: image: postgres:${{ matrix.postgres_version }}-alpine env: POSTGRES_USER: ubuntu - POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~`!@#$%^&*-_=+{}[]()<>,.;:\"'?|/\\ + POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\ POSTGRES_DB: integration_test # Set health checks to wait until postgres has started options: >- @@ -361,7 +361,7 @@ jobs: { "db": { "user": "ubuntu", - "password": "123456abcdefghABCDEFGH~`!@#$%^&*-_=+{}[]()<>,.;:\"'?|/\\", + "password": "123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\", "host": "localhost", "port": "5432", "database": "integration_test" From 7fc743d44678f3a2bbc98b496bc5e03f0aae1103 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 22:55:18 +0100 Subject: [PATCH 27/29] try fix pw --- .github/workflows/postgres-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index 8b2754ab..d624a690 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -319,7 +319,7 @@ jobs: image: postgres:${{ matrix.postgres_version }}-alpine env: POSTGRES_USER: ubuntu - POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\ + POSTGRES_PASSWORD: 123456abcdefghABCDEFGH~`!$%^&*-_=+{}[]()<>,.;:"'|\ POSTGRES_DB: integration_test # Set health checks to wait until postgres has started options: >- @@ -361,7 +361,7 @@ jobs: { "db": { "user": "ubuntu", - "password": "123456abcdefghABCDEFGH~\`\!$%^\&*-_=+{}[]\(\)\<\>,.\;:\"\'\|\\", + "password": "123456abcdefghABCDEFGH~`!$%^&*-_=+{}[]()<>,.;:\"'|\\", "host": "localhost", "port": "5432", "database": "integration_test" From 4e84cf7f56676aedb876e768b79f1947beb9cbec Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 23:00:30 +0100 Subject: [PATCH 28/29] retrigger ci From 9a66c74f6ae23c3a2d005d75dfb4fc8f03121c01 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Wed, 28 Feb 2024 23:07:05 +0100 Subject: [PATCH 29/29] remove faker copypaste thingy :) --- .github/workflows/ci.yml | 6 ----- .github/workflows/cockroach-test.yml | 3 --- .github/workflows/postgres-test.yml | 39 ---------------------------- 3 files changed, 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87d28f03..4d527278 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -85,9 +82,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 diff --git a/.github/workflows/cockroach-test.yml b/.github/workflows/cockroach-test.yml index 1b71852a..7b9b1917 100644 --- a/.github/workflows/cockroach-test.yml +++ b/.github/workflows/cockroach-test.yml @@ -34,9 +34,6 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 diff --git a/.github/workflows/postgres-test.yml b/.github/workflows/postgres-test.yml index d624a690..5b25b176 100644 --- a/.github/workflows/postgres-test.yml +++ b/.github/workflows/postgres-test.yml @@ -40,9 +40,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -94,9 +91,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -161,9 +155,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -219,9 +210,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -281,9 +269,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -335,9 +320,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -402,9 +384,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -458,9 +437,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -513,9 +489,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -568,9 +541,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -622,9 +592,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -676,9 +643,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 @@ -730,9 +694,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Required for docs/versions tests - fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0