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: option to skip tests from command-line #52508

Closed
malthe opened this issue Apr 12, 2024 · 4 comments · Fixed by #52529
Closed

test_runner: option to skip tests from command-line #52508

malthe opened this issue Apr 12, 2024 · 4 comments · Fixed by #52529
Labels
cli Issues and PRs related to the Node.js command line interface. feature request Issues that request new features to be added to Node.js. test_runner Issues and PRs related to the test runner subsystem.

Comments

@malthe
Copy link
Contributor

malthe commented Apr 12, 2024

What is the problem this feature will solve?

For some environments, one or more tests should be skipped because they're testing functionality that's not supported.

For example, testing SSL connectivity in an environment that deliberately does not support it.

What is the feature you are proposing to solve the problem?

Similar to --test-name-pattern, there should be a option to specify a pattern to skip a subset of tests.

Suggestion: --skip-name-pattern – of course, like its related option, it can be specified multiple times.

What alternatives have you considered?

The alternative is to encode this using for example environment variables, rigging up tests using { skip: <runtime-skip-condition> }.

But this is less obvious and arguably less flexible.

@malthe malthe added the feature request Issues that request new features to be added to Node.js. label Apr 12, 2024
@VoltrexKeyva VoltrexKeyva added cli Issues and PRs related to the Node.js command line interface. test_runner Issues and PRs related to the test runner subsystem. labels Apr 12, 2024
@meyfa
Copy link
Contributor

meyfa commented Apr 13, 2024

Given that all test-related CLI flags seem to have a common "--test-" prefix, I suggest calling this --test-skip-pattern instead of --skip-name-pattern.

@MoLow
Copy link
Member

MoLow commented Apr 13, 2024

+1 on adding this. implementation should be trivial if we just negate the existing logic/regex

@avivkeller
Copy link
Member

Hi, @MoLow, @meyfa, and @malthe,

Would you mind if I go ahead and implement this?

@avivkeller
Copy link
Member

Sorry, I didn't wait to hear an answer! I had similar logic from my test runners, so I figured I'd get a head start. Before I knew it, I was done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. feature request Issues that request new features to be added to Node.js. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants