Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d68f6e6

Browse filesBrowse files
Benjamin CoeMylesBorins
authored andcommitted
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: #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>
1 parent 1f01830 commit d68f6e6
Copy full SHA for d68f6e6

File tree

Expand file treeCollapse file tree

3 files changed

+12
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-2
lines changed
Open diff view settings
Collapse file

‎.nycrc‎

Copy file name to clipboardExpand all lines: .nycrc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"exclude": [
33
"**/internal/process/write-coverage.js"
44
],
5+
"compact": false,
56
"reporter": ["html", "text"]
67
}
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ v8:
233233
.PHONY: jstest
234234
jstest: build-addons build-addons-napi ## Runs addon tests and JS tests
235235
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \
236+
--skip-tests=$(CI_SKIP_TESTS) \
236237
$(CI_JS_SUITES) \
237238
$(CI_NATIVE_SUITES)
238239

@@ -263,8 +264,7 @@ test-cov: all
263264
$(MAKE) build-addons
264265
$(MAKE) build-addons-napi
265266
# $(MAKE) cctest
266-
$(MAKE) jstest
267-
$(MAKE) lint
267+
CI_SKIP_TESTS=core_line_numbers.js $(MAKE) jstest
268268

269269
test-parallel: all
270270
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) parallel
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,9 @@ def BuildOptions():
13821382
result.add_option("--flaky-tests",
13831383
help="Regard tests marked as flaky (run|skip|dontcare)",
13841384
default="run")
1385+
result.add_option("--skip-tests",
1386+
help="Tests that should not be executed (comma-separated)",
1387+
default="")
13851388
result.add_option("--warn-unused", help="Report unused rules",
13861389
default=False, action="store_true")
13871390
result.add_option("-j", help="The number of parallel tasks to run",
@@ -1424,6 +1427,7 @@ def ProcessOptions(options):
14241427
options.arch = options.arch.split(',')
14251428
options.mode = options.mode.split(',')
14261429
options.run = options.run.split(',')
1430+
options.skip_tests = options.skip_tests.split(',')
14271431
if options.run == [""]:
14281432
options.run = None
14291433
elif len(options.run) != 2:
@@ -1710,6 +1714,11 @@ def Main():
17101714

17111715
result = None
17121716
def DoSkip(case):
1717+
# A list of tests that should be skipped can be provided. This is
1718+
# useful for tests that fail in some environments, e.g., under coverage.
1719+
if options.skip_tests != [""]:
1720+
if [ st for st in options.skip_tests if st in case.case.file ]:
1721+
return True
17131722
if SKIP in case.outcomes or SLOW in case.outcomes:
17141723
return True
17151724
return FLAKY in case.outcomes and options.flaky_tests == SKIP

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.