From 0799a0b6111b4993b668badce11b933f55ef3300 Mon Sep 17 00:00:00 2001 From: Bilal Godil Date: Fri, 30 Jan 2026 13:11:30 -0800 Subject: [PATCH] attempt test fixes --- .github/workflows/e2e-api-tests.yaml | 24 ++++++++++++++++--- .../e2e-custom-base-port-api-tests.yaml | 24 ++++++++++++++++--- .../e2e-source-of-truth-api-tests.yaml | 24 ++++++++++++++++--- ...rt-dev-and-test-with-custom-base-port.yaml | 2 +- .github/workflows/restart-dev-and-test.yaml | 2 +- .../setup-tests-with-custom-base-port.yaml | 2 +- .github/workflows/setup-tests.yaml | 2 +- 7 files changed, 67 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2e-api-tests.yaml b/.github/workflows/e2e-api-tests.yaml index 81f50f171..33e8da6d7 100644 --- a/.github/workflows/e2e-api-tests.yaml +++ b/.github/workflows/e2e-api-tests.yaml @@ -100,6 +100,9 @@ jobs: - name: Wait on Svix run: pnpx wait-on tcp:localhost:8113 + + - name: Wait on QStash + run: pnpx wait-on tcp:localhost:8125 - name: Initialize database run: pnpm run db:init @@ -153,16 +156,31 @@ jobs: - name: Wait 10 seconds run: sleep 10 + - name: Prime external DB sync + run: | + set -euo pipefail + set -a + source apps/backend/.env.test.local + set +a + baseUrl="http://localhost:${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02" + for _ in 1 2 3; do + curl -fsS -H "Authorization: Bearer ${CRON_SECRET}" \ + "${baseUrl}/api/latest/internal/external-db-sync/sequencer" >/dev/null + curl -fsS -H "Authorization: Bearer ${CRON_SECRET}" \ + "${baseUrl}/api/latest/internal/external-db-sync/poller" >/dev/null + sleep 2 + done + - name: Run tests - run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }} + run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }} - name: Run tests again, to make sure they are stable (attempt 1) if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' - run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }} + run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }} - name: Run tests again, to make sure they are stable (attempt 2) if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' - run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }} + run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }} - name: Verify data integrity run: pnpm run verify-data-integrity --no-bail diff --git a/.github/workflows/e2e-custom-base-port-api-tests.yaml b/.github/workflows/e2e-custom-base-port-api-tests.yaml index 2be786b6c..38a555907 100644 --- a/.github/workflows/e2e-custom-base-port-api-tests.yaml +++ b/.github/workflows/e2e-custom-base-port-api-tests.yaml @@ -94,6 +94,9 @@ jobs: - name: Wait on Svix run: pnpx wait-on tcp:localhost:6713 + + - name: Wait on QStash + run: pnpx wait-on tcp:localhost:6725 - name: Initialize database run: pnpm run db:init @@ -147,16 +150,31 @@ jobs: - name: Wait 10 seconds run: sleep 10 + - name: Prime external DB sync + run: | + set -euo pipefail + set -a + source apps/backend/.env.test.local + set +a + baseUrl="http://localhost:${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02" + for _ in 1 2 3; do + curl -fsS -H "Authorization: Bearer ${CRON_SECRET}" \ + "${baseUrl}/api/latest/internal/external-db-sync/sequencer" >/dev/null + curl -fsS -H "Authorization: Bearer ${CRON_SECRET}" \ + "${baseUrl}/api/latest/internal/external-db-sync/poller" >/dev/null + sleep 2 + done + - name: Run tests - run: pnpm test + run: pnpm test run - name: Run tests again, to make sure they are stable (attempt 1) if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' - run: pnpm test + run: pnpm test run - name: Run tests again, to make sure they are stable (attempt 2) if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' - run: pnpm test + run: pnpm test run - name: Verify data integrity run: pnpm run verify-data-integrity --no-bail diff --git a/.github/workflows/e2e-source-of-truth-api-tests.yaml b/.github/workflows/e2e-source-of-truth-api-tests.yaml index c9cb89e35..9865086fe 100644 --- a/.github/workflows/e2e-source-of-truth-api-tests.yaml +++ b/.github/workflows/e2e-source-of-truth-api-tests.yaml @@ -96,6 +96,9 @@ jobs: - name: Wait on Svix run: pnpx wait-on tcp:localhost:8113 + + - name: Wait on QStash + run: pnpx wait-on tcp:localhost:8125 - name: Create source-of-truth database and schema run: | @@ -154,16 +157,31 @@ jobs: - name: Wait 10 seconds run: sleep 10 + - name: Prime external DB sync + run: | + set -euo pipefail + set -a + source apps/backend/.env.test.local + set +a + baseUrl="http://localhost:${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02" + for _ in 1 2 3; do + curl -fsS -H "Authorization: Bearer ${CRON_SECRET}" \ + "${baseUrl}/api/latest/internal/external-db-sync/sequencer" >/dev/null + curl -fsS -H "Authorization: Bearer ${CRON_SECRET}" \ + "${baseUrl}/api/latest/internal/external-db-sync/poller" >/dev/null + sleep 2 + done + - name: Run tests - run: pnpm test + run: pnpm test run - name: Run tests again, to make sure they are stable (attempt 1) if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' - run: pnpm test + run: pnpm test run - name: Run tests again, to make sure they are stable (attempt 2) if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' - run: pnpm test + run: pnpm test run - name: Verify data integrity run: pnpm run verify-data-integrity --no-bail diff --git a/.github/workflows/restart-dev-and-test-with-custom-base-port.yaml b/.github/workflows/restart-dev-and-test-with-custom-base-port.yaml index 6c1f64f45..6f22cce5f 100644 --- a/.github/workflows/restart-dev-and-test-with-custom-base-port.yaml +++ b/.github/workflows/restart-dev-and-test-with-custom-base-port.yaml @@ -38,7 +38,7 @@ jobs: run: pnpm run restart-dev-environment - name: Run tests - run: pnpm run test --reporter=verbose + run: pnpm run test run --reporter=verbose - name: Print dev server logs run: cat dev-server.log.untracked.txt diff --git a/.github/workflows/restart-dev-and-test.yaml b/.github/workflows/restart-dev-and-test.yaml index 831148e4e..e300fa8b1 100644 --- a/.github/workflows/restart-dev-and-test.yaml +++ b/.github/workflows/restart-dev-and-test.yaml @@ -36,7 +36,7 @@ jobs: run: pnpm run restart-dev-environment - name: Run tests - run: pnpm run test --reporter=verbose + run: pnpm run test run --reporter=verbose - name: Print dev server logs run: cat dev-server.log.untracked.txt diff --git a/.github/workflows/setup-tests-with-custom-base-port.yaml b/.github/workflows/setup-tests-with-custom-base-port.yaml index b3d15e503..c08290574 100644 --- a/.github/workflows/setup-tests-with-custom-base-port.yaml +++ b/.github/workflows/setup-tests-with-custom-base-port.yaml @@ -46,4 +46,4 @@ jobs: tail: true wait-for: 120s log-output-if: true - - run: pnpm run test --reporter=verbose + - run: pnpm run test run --reporter=verbose diff --git a/.github/workflows/setup-tests.yaml b/.github/workflows/setup-tests.yaml index d20748c93..9dd86c057 100644 --- a/.github/workflows/setup-tests.yaml +++ b/.github/workflows/setup-tests.yaml @@ -43,4 +43,4 @@ jobs: tail: true wait-for: 120s log-output-if: true - - run: pnpm run test --reporter=verbose + - run: pnpm run test run --reporter=verbose