Skip to content

Remove dead process.env.CI skip guards from the integration tests - #30

Merged
pubino merged 1 commit into
mainfrom
chore/remove-dead-ci-guards
Aug 19, 2026
Merged

Remove dead process.env.CI skip guards from the integration tests#30
pubino merged 1 commit into
mainfrom
chore/remove-dead-ci-guards

Conversation

@pubino

@pubino pubino commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #29, which flagged these.

All four integration suites opened with a guard intended to skip them in CI:

if (process.env.CI) {
  console.log('Skipping ... in CI environment');
  return;
}

The guards never fired. The suites run via docker compose run, and the test service in docker-compose.yml passes only its explicit environment: list, so CI never reaches the container — process.env.CI is undefined inside it even on a GitHub runner. These tests have always run in CI, which is exactly what the guards were written to prevent.

Why remove rather than propagate CI

These four files are the entire integration suite, so honouring the guards would leave CI with no integration coverage.

One correction to what I wrote in #29: I said honouring them would "green CI while testing nothing." That's not right — Jest rejects a describe block containing no tests, so with CI set all four suites error out. Demonstrated in the container:

Test Suites Tests
guards present, CI=true 4 failed, 4 total 0 total
guards removed, CI=true 4 passed, 4 total 40 passed

So the guards would have failed loudly rather than quietly — smaller risk than I first described, but either way they no longer describe intended behaviour and are misleading to read.

The flaky-browser-launch concern behind them is better addressed at the source: the unbounded PlaywrightManager.close() that was hanging the keepalive hooks got fixed in b8c907a.

Verification

In the test container:

  • CI=true npm run test:integration:direct40/40 pass (was 0 tests / 4 failed suites with the guards)
  • npm run test:all136/136 pass, 10/10 suites

No production code touched; the diff is 24 deleted lines across the four test files.

All four integration suites opened with:

    if (process.env.CI) {
      console.log('Skipping ... in CI environment');
      return;
    }

The guards never fired. The suites run via `docker compose run`, and the test
service passes only its explicit `environment:` list, so CI never reaches the
container -- `process.env.CI` is undefined there even on a GitHub runner. The
tests have always run in CI, which is what the guards were written to prevent.

Removing them rather than propagating CI: these four files are the whole
integration suite, so honouring the guards would leave CI with no integration
coverage at all. Note that it would not fail quietly -- Jest rejects a describe
block with no tests, so with CI set all four suites error out with
`Tests: 0 total`. Either way the guards no longer describe intended behaviour.

The flaky-browser-launch concern behind them is better addressed at the source;
the unbounded PlaywrightManager.close() that hung the keepalive hooks was fixed
in b8c907a.

Verified in the test container:
- CI=true now runs the integration suite: 40/40 pass (was 0 tests, 4 suites
  failed, with the guards present)
- full suite: 136/136 pass
@pubino
pubino merged commit 77d7e61 into main Aug 19, 2026
4 checks passed
@pubino
pubino deleted the chore/remove-dead-ci-guards branch August 19, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant