From 8219f0dde5104773b333a291bf565b61b252303e Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Wed, 14 Jan 2026 02:10:03 +1000 Subject: [PATCH] ci: add pre-test cleanup step to prevent hitting resource limits Run cleanup-orphans.ts before tests to clear any leftover test data that might cause tests to fail due to hitting the maximum agent/collection limits. --- .github/workflows/integration-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index e956d75..1a54b91 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -44,6 +44,12 @@ jobs: - name: Build packages run: pnpm build + - name: Cleanup orphaned test data (pre-test) + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + INTEGRATION_TEST_USER_ID: ${{ secrets.INTEGRATION_TEST_USER_ID }} + run: pnpm --filter=@tpmjs/web tsx src/test/integration/_helpers/cleanup-orphans.ts + - name: Wait for API run: | echo "Checking if API is available at $TEST_BASE_URL..."