Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: handle undefined test locations #52036

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Mar 10, 2024

This commit updates the built in reporters to check for the documented case of a test's location being undefined.

As a drive by fix, the C++ code for computing the test location now returns undefined if the script location is empty. This lets tests run inside of eval().

This commit updates the built in reporters to check for the
documented case of a test's location being undefined.

As a drive by fix, the C++ code for computing the test location
now returns undefined if the script location is empty. This lets
tests run inside of eval().
@cjihrig cjihrig requested review from MoLow and atlowChemi March 10, 2024 18:05
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. util Issues and PRs related to the built-in util module. labels Mar 10, 2024
@MoLow MoLow added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 11, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 11, 2024
@nodejs-github-bot
Copy link
Collaborator

@MoLow
Copy link
Member

MoLow commented Mar 11, 2024

This commit updates the built in reporters to check for the documented case of a test's location being undefined.

another use case is test() inside the REPL, can test that as well, but if it uses eval internally it might just be redundant

@nodejs-github-bot
Copy link
Collaborator

@MoLow MoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 11, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 12, 2024
@nodejs-github-bot nodejs-github-bot merged commit 3c5764a into nodejs:main Mar 12, 2024
68 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3c5764a

@cjihrig cjihrig deleted the repl-tests branch March 13, 2024 13:39
rdw-msft pushed a commit to rdw-msft/node that referenced this pull request Mar 26, 2024
This commit updates the built in reporters to check for the
documented case of a test's location being undefined.

As a drive by fix, the C++ code for computing the test location
now returns undefined if the script location is empty. This lets
tests run inside of eval().

PR-URL: nodejs#52036
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
This commit updates the built in reporters to check for the
documented case of a test's location being undefined.

As a drive by fix, the C++ code for computing the test location
now returns undefined if the script location is empty. This lets
tests run inside of eval().

PR-URL: #52036
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
This commit updates the built in reporters to check for the
documented case of a test's location being undefined.

As a drive by fix, the C++ code for computing the test location
now returns undefined if the script location is empty. This lets
tests run inside of eval().

PR-URL: #52036
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
jcbhmr pushed a commit to jcbhmr/node that referenced this pull request May 15, 2024
This commit updates the built in reporters to check for the
documented case of a test's location being undefined.

As a drive by fix, the C++ code for computing the test location
now returns undefined if the script location is empty. This lets
tests run inside of eval().

PR-URL: nodejs#52036
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants