diff options
author | Benjamin Coe <ben@npmjs.com> | 2018-05-16 18:03:53 -0700 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2018-05-22 12:45:54 +0400 |
commit | 16377146b6ef24130c3a8ae1657328eaafb963ff (patch) | |
tree | 3acddefe57e57d33f79b6a7e852be05cfe5c8c5f /tools/test.py | |
parent | e3166554684ccba7f4a16fc827f8cd048e2d2c84 (diff) | |
download | node-new-16377146b6ef24130c3a8ae1657328eaafb963ff.tar.gz |
test: fix tests that fail under coverage
Make test runner capable of skipping tests, which makes it possible
to skip the failing test/message/core_line_numbers.js test.
Make nyc no longer generate compact instrumentation (this causes
significantly different code output, which leads to failing test
assertions).
PR-URL: https://github.com/nodejs/node/pull/20794
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'tools/test.py')
-rwxr-xr-x | tools/test.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/test.py b/tools/test.py index 66b9c7291f..e5581e8da4 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1382,6 +1382,9 @@ def BuildOptions(): result.add_option("--flaky-tests", help="Regard tests marked as flaky (run|skip|dontcare)", default="run") + result.add_option("--skip-tests", + help="Tests that should not be executed (comma-separated)", + default="") result.add_option("--warn-unused", help="Report unused rules", default=False, action="store_true") result.add_option("-j", help="The number of parallel tasks to run", @@ -1424,6 +1427,7 @@ def ProcessOptions(options): options.arch = options.arch.split(',') options.mode = options.mode.split(',') options.run = options.run.split(',') + options.skip_tests = options.skip_tests.split(',') if options.run == [""]: options.run = None elif len(options.run) != 2: @@ -1710,6 +1714,11 @@ def Main(): result = None def DoSkip(case): + # A list of tests that should be skipped can be provided. This is + # useful for tests that fail in some environments, e.g., under coverage. + if options.skip_tests != [""]: + if [ st for st in options.skip_tests if st in case.case.file ]: + return True if SKIP in case.outcomes or SLOW in case.outcomes: return True return FLAKY in case.outcomes and options.flaky_tests == SKIP |