test(node): Migrate fs & contextLines-filename integration tests to helpers#21958
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves two node integration suites onto the shared runner helpers.
fs-instrumentation— split the threeserver*.tsinto onescenario.mjs(full express app) plus threeinstrument.mjsvariants (full / record-paths-only / record-errors-only), driven viacreateCjsTestswithcopyPaths: ['fixtures']. Runs in CJS, same as before.contextLines/filename-with-spaces— usescreateEsmAndCjsTestsoff the existingscenario with space.mjs+instrument.mjs, replacing the hand-written.cjs. The CJS assertions are updated to the auto-generated file structure (inlineSentry.initmoves into the instrument file, so the context lines shift accordingly). Still exercises both ESM and CJS.Intentionally left out:
contextLines/memory-leakThat suite's lsof-based file-handle leak check (regression test for #14892) derives
mainPathfrom__dirname. Under the helper'stmp_<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.tssibling 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 currentcreateRunnersetup.🤖 Generated with Claude Code