From 53213370d182a37ff2583450294139460fec8b6f Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Sun, 14 Apr 2024 12:36:01 -0400 Subject: [PATCH 1/6] test_runner: add --test-skip-pattern cli option --- doc/api/cli.md | 17 +++++++ doc/api/test.md | 23 ++++++--- doc/node.1 | 6 ++- lib/internal/test_runner/runner.js | 24 ++++++++- lib/internal/test_runner/test.js | 50 +++++++++++++------ lib/internal/test_runner/utils.js | 5 ++ src/node_options.cc | 3 ++ src/node_options.h | 1 + .../output/name_and_skip_patterns.js | 10 ++++ .../output/name_and_skip_patterns.snapshot | 15 ++++++ .../test-runner/output/skip_pattern.js | 20 ++++++++ .../test-runner/output/skip_pattern.snapshot | 37 ++++++++++++++ test/parallel/test-runner-output.mjs | 2 + 13 files changed, 186 insertions(+), 27 deletions(-) create mode 100644 test/fixtures/test-runner/output/name_and_skip_patterns.js create mode 100644 test/fixtures/test-runner/output/name_and_skip_patterns.snapshot create mode 100644 test/fixtures/test-runner/output/skip_pattern.js create mode 100644 test/fixtures/test-runner/output/skip_pattern.snapshot diff --git a/doc/api/cli.md b/doc/api/cli.md index f08afb737d41b4..28d1b27d449d73 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1969,6 +1969,9 @@ A regular expression that configures the test runner to only execute tests whose name matches the provided pattern. See the documentation on [filtering tests by name][] for more details. +If both the `--test-name-pattern` and `--test-skip-pattern` arguments are +supplied, only `--test-name-pattern` will be applied. + ### `--test-only` + +A regular expression that configures the test runner to skip tests +whose name matches the provided pattern. See the documentation on +[filtering tests by name][] for more details. + +If both `--test-name-pattern` and `--test-skip-pattern` are supplied, +tests must satisfy **both** requirements in order to be executed. + ### `--test-timeout`