Skip to content

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

Description

@malthe

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.

Activity

  1. added
    cliIssues and PRs related to the Node.js command-line interface.
    test_runnerIssues and PRs related to the test runner subsystem.
    on Apr 12, 2024
  2. meyfa commented on Apr 13, 2024

    @meyfa
    Contributor

    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.

  3. MoLow commented on Apr 13, 2024

    @MoLow
    Member

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

  4. avivkeller commented on Apr 14, 2024

    @avivkeller
    Member

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

    Would you mind if I go ahead and implement this?

  5. avivkeller commented on Apr 14, 2024

    @avivkeller
    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!

  6. moved this from Awaiting Triage to Done in Node.js feature requestson Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliIssues and PRs related to the Node.js command-line interface.feature requestIssues requesting new Node.js features.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions