Skip to content

Commit fcb95eb

Browse files
fix: prevent cache collision between integration and E2E tests
The integration tests were failing because they were sharing the same cache key and path with E2E tests, causing cache collisions. When integration tests restored a cache created by E2E tests, the data was in the wrong database schema (E2E uses sharded schemas like shard_1, while integration uses the default schema). This fix: - Gives integration tests a unique cache path (backups/integration.sql) - Gives each E2E shard a unique cache path (backups/e2e-shard-N.sql) - Passes the correct DATABASE_URL to cache-db action so seeding/restore targets the same schema the tests will use This ensures each test suite has its own isolated database cache and prevents the flaky test failures where integration tests found empty databases (0 results instead of expected data). Co-Authored-By: Volnei Munhoz <[email protected]>
1 parent 8e51eca commit fcb95eb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ jobs:
9494
- uses: ./.github/actions/yarn-install
9595
- uses: ./.github/actions/yarn-playwright-install
9696
- uses: ./.github/actions/cache-db
97+
with:
98+
path: backups/e2e-shard-${{ matrix.shard }}.sql
99+
DATABASE_URL: ${{ secrets.CI_DATABASE_URL }}?schema=shard_${{ matrix.shard }}
97100
- uses: ./.github/actions/cache-build
98101

99102
- name: Run Tests

.github/workflows/integration-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ jobs:
7979
- uses: ./.github/actions/dangerous-git-checkout
8080
- uses: ./.github/actions/yarn-install
8181
- uses: ./.github/actions/cache-db
82+
with:
83+
path: backups/integration.sql
84+
DATABASE_URL: ${{ secrets.CI_DATABASE_URL }}
8285
- name: Run Tests
8386
run: yarn test -- --integrationTestsOnly
8487
# TODO: Generate test results so we can upload them

0 commit comments

Comments
 (0)