Skip to content

test(node): Migrate fs & contextLines-filename integration tests to helpers#21958

Merged
mydea merged 1 commit into
developfrom
fn/migrate-fs-contextlines-integration-tests
Jul 6, 2026
Merged

test(node): Migrate fs & contextLines-filename integration tests to helpers#21958
mydea merged 1 commit into
developfrom
fn/migrate-fs-contextlines-integration-tests

Conversation

@mydea

@mydea mydea commented Jul 3, 2026

Copy link
Copy Markdown
Member

Moves two node integration suites onto the shared runner helpers.

  • fs-instrumentation — split the three server*.ts into one scenario.mjs (full express app) plus three instrument.mjs variants (full / record-paths-only / record-errors-only), driven via createCjsTests with copyPaths: ['fixtures']. Runs in CJS, same as before.
  • contextLines/filename-with-spaces — uses createEsmAndCjsTests off the existing scenario with space.mjs + instrument.mjs, replacing the hand-written .cjs. The CJS assertions are updated to the auto-generated file structure (inline Sentry.init moves into the instrument file, so the context lines shift accordingly). Still exercises both ESM and CJS.

Intentionally left out: contextLines/memory-leak

That suite's lsof-based file-handle leak check (regression test for #14892) derives mainPath from __dirname. Under the helper's tmp_<id>/ run dir the derived path no longer matches any real file path, which would silently turn the leak check into a no-op. It also imports .ts sibling helpers that plain-node CJS can't load. Migrating it safely would require rewriting the leak-detection logic in a way that can't be confidently validated, so it stays on its current createRunner setup.

🤖 Generated with Claude Code

…elpers

Move two node integration suites onto the shared runner helpers:

- `fs-instrumentation`: split the three `server*.ts` into one `scenario.mjs`
  (full express app) plus three `instrument.mjs` variants (full /
  record-paths-only / record-errors-only), driven via `createCjsTests` with
  `copyPaths: ['fixtures']`. Runs in CJS as before.
- `contextLines/filename-with-spaces`: use `createEsmAndCjsTests` off the
  existing `scenario with space.mjs` + `instrument.mjs`, replacing the
  hand-written `.cjs`. CJS assertions updated to the auto-generated file
  structure (inline init removed → context lines shift accordingly).

`contextLines/memory-leak` is intentionally left on its current `createRunner`
setup: its lsof-based file-handle leak check derives paths from `__dirname`,
which the helper's tmp-dir indirection breaks, so migrating it would silently
neuter the regression check (issue #14892).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea mydea requested a review from a team as a code owner July 3, 2026 12:32
@mydea mydea requested review from JPeer264 and andreiborza and removed request for a team July 3, 2026 12:32

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup.

@mydea mydea merged commit 96cbf5e into develop Jul 6, 2026
57 checks passed
@mydea mydea deleted the fn/migrate-fs-contextlines-integration-tests branch July 6, 2026 08:26
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.

2 participants