summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKeyhan Vakil <kvakil@sylph.kvakil.me>2022-10-03 10:45:40 -0700
committerGitHub <noreply@github.com>2022-10-03 17:45:40 +0000
commit691f8d14274fa76ffaba00c07ed709bc83af144d (patch)
tree6a7f2d5f5450d89b4a22d7e474dc0d1fa92c62c6 /Makefile
parent587367d1079156731f4475d23dede91e43d224eb (diff)
downloadnode-new-691f8d14274fa76ffaba00c07ed709bc83af144d.tar.gz
build: convert V8 test JSON to JUnit XML
This introduces some code to convert from V8's test JSON output to JUnit XML. We need this because V8's latest refactor of their test runner has made it difficult to float our JUnit reporter patch on top (see the referenced issue). I also think that there needs to be the same changes to vcbuild.bat, but I don't know how to do test those yet. I can create a Windows VM and test it if we decide to go with this approach. Refs: https://github.com/nodejs/node-v8/issues/236 PR-URL: https://github.com/nodejs/node/pull/44049 Fixes: https://github.com/nodejs/node-v8/issues/236 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 9c01f8f244..05fdc15098 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,27 @@ ifdef ENABLE_V8_TAP
TAP_V8 := --junitout $(PWD)/v8-tap.xml
TAP_V8_INTL := --junitout $(PWD)/v8-intl-tap.xml
TAP_V8_BENCHMARKS := --junitout $(PWD)/v8-benchmarks-tap.xml
+define convert_to_junit
+ @true
+endef
+endif
+
+ifdef ENABLE_CONVERT_V8_JSON_TO_XML
+ TAP_V8_JSON := $(PWD)/v8-tap.json
+ TAP_V8_INTL_JSON := $(PWD)/v8-intl-tap.json
+ TAP_V8_BENCHMARKS_JSON := $(PWD)/v8-benchmarks-tap.json
+
+ # By default, the V8's JSON test output only includes the tests which have
+ # failed. We use --slow-tests-cutoff to ensure that all tests are present
+ # in the output, including those which pass.
+ TAP_V8 := --json-test-results $(TAP_V8_JSON) --slow-tests-cutoff 1000000
+ TAP_V8_INTL := --json-test-results $(TAP_V8_INTL_JSON) --slow-tests-cutoff 1000000
+ TAP_V8_BENCHMARKS := --json-test-results $(TAP_V8_BENCHMARKS_JSON) --slow-tests-cutoff 1000000
+
+define convert_to_junit
+ export PATH="$(NO_BIN_OVERRIDE_PATH)" && \
+ $(PYTHON) tools/v8-json-to-junit.py < $(1) > $(1:.json=.xml)
+endef
endif
V8_TEST_OPTIONS = $(V8_EXTRA_TEST_OPTIONS)
@@ -683,6 +704,7 @@ test-v8: v8 ## Runs the V8 test suite on deps/v8.
$(PYTHON) deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) $(V8_TEST_OPTIONS) \
mjsunit cctest debugger inspector message preparser \
$(TAP_V8)
+ $(call convert_to_junit,$(TAP_V8_JSON))
$(info Testing hash seed)
$(MAKE) test-hash-seed
@@ -691,12 +713,14 @@ test-v8-intl: v8
$(PYTHON) deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \
intl \
$(TAP_V8_INTL)
+ $(call convert_to_junit,$(TAP_V8_INTL_JSON))
test-v8-benchmarks: v8
export PATH="$(NO_BIN_OVERRIDE_PATH)" && \
$(PYTHON) deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \
benchmarks \
$(TAP_V8_BENCHMARKS)
+ $(call convert_to_junit,$(TAP_V8_BENCHMARKS_JSON))
test-v8-updates:
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) v8-updates