GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_runner: refactor snapshots to support multiple files in the same process by cjihrig · Pull Request #53853 · nodejs/node

Conversation

@cjihrig

@cjihrig cjihrig commented Jul 15, 2024

Copy link
Copy Markdown
Contributor
test_runner: add context.filePath

This commit adds a filePath getter to the TestContext and
SuiteContext classes. This allows a context to be mapped back to
the original test file that created it, even if it was imported
from another file. This is useful for mapping features like test
snapshots to the correct test file. This is also prep work for
supporting running test files in the test runner process.

test_runner: refactor snapshots to get file from context

This commit refactors the internals of snapshot tests to get the
name of the test file from the test context instead of passing
it to the SnapshotManager constructor. This is prep work for
supporting running test files in the test runner process.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@cjihrig cjihrig added the semver-minor PRs that contain new features and should be released in the next minor version. label Jul 15, 2024
@nodejs-github-bot

nodejs-github-bot commented Jul 15, 2024

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jul 15, 2024
MoLow
MoLow reviewed Jul 15, 2024
View reviewed changes
Comment thread doc/api/test.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

MoLow
MoLow reviewed Jul 15, 2024
View reviewed changes
Comment thread doc/api/test.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig
cjihrig force-pushed the snapshot branch from 8349967 to e89ed07 Compare July 15, 2024 12:45
@cjihrig
cjihrig requested a review from MoLow July 15, 2024 12:46
@cjihrig cjihrig added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 15, 2024
@github-actions github-actions Bot added request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Jul 15, 2024
@github-actions

github-actions Bot commented Jul 15, 2024

Copy link
Copy Markdown
Contributor
Failed to start CI
   ⚠  No approving reviews found
   ℹ  request-ci label was added by a Collaborator after the last push event.
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Starting PR CI job
✔  PR CI job successfully started

[DEBUG] SyntaxError: Unexpected token '<', ")
at Request.json (file:///opt/hostedtoolcache/node/20.15.0/x64/lib/node_modules/@node-core/utils/lib/request.js:53:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Request.query (file:///opt/hostedtoolcache/node/20.15.0/x64/lib/node_modules/@node-core/utils/lib/request.js:227:20)
at async Request.gql (file:///opt/hostedtoolcache/node/20.15.0/x64/lib/node_modules/@node-core/utils/lib/request.js:118:22)
at async PRData.getPR (file:///opt/hostedtoolcache/node/20.15.0/x64/lib/node_modules/@node-core/utils/lib/pr_data.js:82:20)
at async RunPRJob.start (file:///opt/hostedtoolcache/node/20.15.0/x64/lib/node_modules/@node-core/utils/lib/ci/run_ci.js:106:7)
at async RunPRJobCommand.start (file:///opt/hostedtoolcache/node/20.15.0/x64/lib/node_modules/@node-core/utils/bin/ncu-ci.js:300:11)
✘ Failed to start CI

https://github.com/nodejs/node/actions/runs/9939801944

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Jul 15, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/60329/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@avivkeller avivkeller removed the request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. label Jul 15, 2024
@nodejs-github-bot

nodejs-github-bot commented Jul 15, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/60334/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Jul 15, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/60335/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MoLow
MoLow approved these changes Jul 15, 2024
View reviewed changes
atlowChemi
atlowChemi approved these changes Jul 15, 2024
View reviewed changes
cjihrig added 2 commits July 15, 2024 16:23
@cjihrig
test_runner: add context.filePath
e5de45a
This commit adds a filePath getter to the TestContext and
SuiteContext classes. This allows a context to be mapped back to
the original test file that created it, even if it was imported
from another file. This is useful for mapping features like test
snapshots to the correct test file. This is also prep work for
supporting running test files in the test runner process.
@cjihrig
test_runner: refactor snapshots to get file from context
f4bff7d
This commit refactors the internals of snapshot tests to get the
name of the test file from the test context instead of passing
it to the SnapshotManager constructor. This is prep work for
supporting running test files in the test runner process.
@cjihrig
cjihrig force-pushed the snapshot branch from e89ed07 to f4bff7d Compare July 15, 2024 20:29
@cjihrig

cjihrig commented Jul 15, 2024

Copy link
Copy Markdown
Contributor Author

Rebased after #53833.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig cjihrig added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 15, 2024
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 15, 2024
@nodejs-github-bot

nodejs-github-bot commented Jul 15, 2024 •
edited by cjihrig
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/60343/ 🟡

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig cjihrig added author ready PRs with CI started, the required approvals, and no outstanding review comments. and removed needs-ci PRs that need a full CI run. labels Jul 15, 2024
benjamingr
benjamingr approved these changes Jul 15, 2024
View reviewed changes
@cjihrig cjihrig added the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 15, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 17, 2024
@nodejs-github-bot nodejs-github-bot added the commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. label Jul 17, 2024
@nodejs-github-bot

nodejs-github-bot commented Jul 17, 2024

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/53853
✔  Done loading data for nodejs/node/pull/53853
----------------------------------- PR info ------------------------------------
Title      test_runner: refactor snapshots to support multiple files in the same process (#53853)
Author     Colin Ihrig <[email protected]> (@cjihrig)
Branch     cjihrig:snapshot -> nodejs:main
Labels     semver-minor, author ready, test_runner
Commits    2
 - test_runner: add context.filePath
 - test_runner: refactor snapshots to get file from context
Committers 1
 - cjihrig <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 15 Jul 2024 05:09:30 GMT
   ✔  Approvals: 3
   ✔  - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/53853#pullrequestreview-2178415741
   ✔  - Chemi Atlow (@atlowChemi): https://github.com/nodejs/node/pull/53853#pullrequestreview-2178504436
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/53853#pullrequestreview-2178740224
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-07-15T20:38:54Z: https://ci.nodejs.org/job/node-test-pull-request/60343/
- Querying data for job/node-test-pull-request/60343/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 53853
From https://github.com/nodejs/node
 * branch                  refs/pull/53853/merge -> FETCH_HEAD
✔  Fetched commits as 0b1ff6965e3b..f4bff7dca35b
--------------------------------------------------------------------------------
[main 60a4b34380] test_runner: add context.filePath
 Author: cjihrig <[email protected]>
 Date: Sun Jul 14 23:37:10 2024 -0400
 4 files changed, 84 insertions(+), 2 deletions(-)
 create mode 100644 test/parallel/test-runner-test-filepath.js
[main 9cfc8e0704] test_runner: refactor snapshots to get file from context
 Author: cjihrig <[email protected]>
 Date: Sun Jul 14 20:33:13 2024 -0400
 5 files changed, 171 insertions(+), 143 deletions(-)
 create mode 100644 test/fixtures/test-runner/snapshots/imported-tests.js
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: add context.filePath

This commit adds a filePath getter to the TestContext and
SuiteContext classes. This allows a context to be mapped back to
the original test file that created it, even if it was imported
from another file. This is useful for mapping features like test
snapshots to the correct test file. This is also prep work for
supporting running test files in the test runner process.

PR-URL: #53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD 40a472110e] test_runner: add context.filePath
Author: cjihrig <[email protected]>
Date: Sun Jul 14 23:37:10 2024 -0400
4 files changed, 84 insertions(+), 2 deletions(-)
create mode 100644 test/parallel/test-runner-test-filepath.js
Rebasing (3/4)
Rebasing (4/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: refactor snapshots to get file from context

This commit refactors the internals of snapshot tests to get the
name of the test file from the test context instead of passing
it to the SnapshotManager constructor. This is prep work for
supporting running test files in the test runner process.

PR-URL: #53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD 62430463a2] test_runner: refactor snapshots to get file from context
Author: cjihrig <[email protected]>
Date: Sun Jul 14 20:33:13 2024 -0400
5 files changed, 171 insertions(+), 143 deletions(-)
create mode 100644 test/fixtures/test-runner/snapshots/imported-tests.js

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/9968639447

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MoLow MoLow added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Jul 17, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jul 17, 2024
@nodejs-github-bot

nodejs-github-bot commented Jul 17, 2024

Copy link
Copy Markdown
Collaborator

Landed in 0b1ff69...05ca035

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nodejs-github-bot pushed a commit that referenced this pull request Jul 17, 2024
@cjihrig @nodejs-github-bot
test_runner: add context.filePath
2ce7c69
This commit adds a filePath getter to the TestContext and
SuiteContext classes. This allows a context to be mapped back to
the original test file that created it, even if it was imported
from another file. This is useful for mapping features like test
snapshots to the correct test file. This is also prep work for
supporting running test files in the test runner process.

PR-URL: #53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Jul 17, 2024
@cjihrig @nodejs-github-bot
test_runner: refactor snapshots to get file from context
05ca035
This commit refactors the internals of snapshot tests to get the
name of the test file from the test context instead of passing
it to the SnapshotManager constructor. This is prep work for
supporting running test files in the test runner process.

PR-URL: #53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@nodejs-github-bot nodejs-github-bot closed this Jul 17, 2024
@cjihrig
cjihrig deleted the snapshot branch July 17, 2024 15:35
ehsankhfr pushed a commit to ehsankhfr/node that referenced this pull request Jul 18, 2024
@cjihrig @ehsankhfr
test_runner: add context.filePath
91f8ced
This commit adds a filePath getter to the TestContext and
SuiteContext classes. This allows a context to be mapped back to
the original test file that created it, even if it was imported
from another file. This is useful for mapping features like test
snapshots to the correct test file. This is also prep work for
supporting running test files in the test runner process.

PR-URL: nodejs#53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
ehsankhfr pushed a commit to ehsankhfr/node that referenced this pull request Jul 18, 2024
@cjihrig @ehsankhfr
test_runner: refactor snapshots to get file from context
16941c3
This commit refactors the internals of snapshot tests to get the
name of the test file from the test context instead of passing
it to the SnapshotManager constructor. This is prep work for
supporting running test files in the test runner process.

PR-URL: nodejs#53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos pushed a commit that referenced this pull request Jul 28, 2024
@cjihrig @targos
test_runner: add context.filePath
698e44f
This commit adds a filePath getter to the TestContext and
SuiteContext classes. This allows a context to be mapped back to
the original test file that created it, even if it was imported
from another file. This is useful for mapping features like test
snapshots to the correct test file. This is also prep work for
supporting running test files in the test runner process.

PR-URL: #53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos pushed a commit that referenced this pull request Jul 28, 2024
@cjihrig @targos
test_runner: refactor snapshots to get file from context
6ad6e01
This commit refactors the internals of snapshot tests to get the
name of the test file from the test context instead of passing
it to the SnapshotManager constructor. This is prep work for
supporting running test files in the test runner process.

PR-URL: #53853
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Jul 30, 2024
v22.6.0 proposal #54123
Merged
RafaelGSS added a commit that referenced this pull request Jul 30, 2024
@RafaelGSS
2024-07-31, Version 22.6.0 (Current)
d77f596
Notable changes:

deps:
  * (SEMVER-MINOR) V8: backport 7857eb34db42 (Stephen Belanger) #53997
http:
  * (SEMVER-MINOR) add diagnostics channel `http.client.request.error` (Kohei Ueno) #54054
inspector:
  * (SEMVER-MINOR) add initial support for network inspection (Kohei Ueno) #53593
lib,src:
  * drop --experimental-network-imports (Rafael Gonzaga) #53822
meta:
  * add jake to collaborators (jakecastelli) #54004
module:
  * (SEMVER-MINOR) add --experimental-strip-types (Marco Ippolito) #53725
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
stream:
  * (SEMVER-MINOR) expose DuplexPair API (Austin Wright) #34111
test_runner:
  * (SEMVER-MINOR) fix support watch with run(), add globPatterns option (Matteo Collina) #53866
  * (SEMVER-MINOR) refactor snapshots to get file from context (Colin Ihrig) #53853
  * (SEMVER-MINOR) add context.filePath (Colin Ihrig) #53853

PR-URL: #54123
RafaelGSS added a commit that referenced this pull request Aug 5, 2024
@RafaelGSS
2024-08-06, Version 22.6.0 (Current)
b096e41
Notable changes:

deps:
  * (SEMVER-MINOR) V8: backport 7857eb34db42 (Stephen Belanger) #53997
http:
  * (SEMVER-MINOR) add diagnostics channel `http.client.request.error` (Kohei Ueno) #54054
inspector:
  * (SEMVER-MINOR) add initial support for network inspection (Kohei Ueno) #53593
lib,src:
  * drop --experimental-network-imports (Rafael Gonzaga) #53822
meta:
  * add jake to collaborators (jakecastelli) #54004
module:
  * (SEMVER-MINOR) add --experimental-strip-types (Marco Ippolito) #53725
stream:
  * (SEMVER-MINOR) expose DuplexPair API (Austin Wright) #34111
test_runner:
  * (SEMVER-MINOR) fix support watch with run(), add globPatterns option (Matteo Collina) #53866
  * (SEMVER-MINOR) refactor snapshots to get file from context (Colin Ihrig) #53853
  * (SEMVER-MINOR) add context.filePath (Colin Ihrig) #53853

PR-URL: #54123
RafaelGSS added a commit that referenced this pull request Aug 6, 2024
@RafaelGSS
2024-08-06, Version 22.6.0 (Current)
3660ad5
Notable changes:

deps:
  * (SEMVER-MINOR) V8: backport 7857eb34db42 (Stephen Belanger) #53997
http:
  * (SEMVER-MINOR) add diagnostics channel `http.client.request.error` (Kohei Ueno) #54054
inspector:
  * (SEMVER-MINOR) add initial support for network inspection (Kohei Ueno) #53593
lib,src:
  * drop --experimental-network-imports (Rafael Gonzaga) #53822
meta:
  * add jake to collaborators (jakecastelli) #54004
module:
  * (SEMVER-MINOR) add --experimental-strip-types (Marco Ippolito) #53725
stream:
  * (SEMVER-MINOR) expose DuplexPair API (Austin Wright) #34111
test_runner:
  * (SEMVER-MINOR) fix support watch with run(), add globPatterns option (Matteo Collina) #53866
  * (SEMVER-MINOR) refactor snapshots to get file from context (Colin Ihrig) #53853
  * (SEMVER-MINOR) add context.filePath (Colin Ihrig) #53853

PR-URL: #54123
@targos targos added the dont-land-on-v20.x label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@benjamingr benjamingr benjamingr approved these changes
@MoLow MoLow MoLow approved these changes
@atlowChemi atlowChemi atlowChemi approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. semver-minor PRs that contain new features and should be released in the next minor version. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@cjihrig @nodejs-github-bot @benjamingr @MoLow @atlowChemi @targos @avivkeller
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.