Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: change jenkins reporter #56808

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,15 @@ endif
# Related CI job: node-test-commit-arm-fanned
test-ci-native: LOGLEVEL := info ## Build and test addons without building anything else.
test-ci-native: | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/sqlite/.buildstamp
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap --error-reporter \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES)

.PHONY: test-ci-js
# This target should not use a native compiler at all
# Related CI job: node-test-commit-arm-fanned
test-ci-js: | clear-stalled ## Build and test JavaScript with building anything else.
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap --error-reporter \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
--skip-tests=$(CI_SKIP_TESTS) \
$(TEST_CI_ARGS) $(CI_JS_SUITES)
Expand All @@ -594,7 +594,7 @@ test-ci-js: | clear-stalled ## Build and test JavaScript with building anything
test-ci: LOGLEVEL := info ## Build and test everything (CI).
test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests doc-only
out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap --error-reporter \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) $(CI_DOC)
$(NODE) ./test/embedding/test-embedding.js
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-assert-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@
Object.prototype.get = () => { throw new Error('failed'); };
assert.throws(() => assert.fail(''), { code: 'ERR_ASSERTION' });
delete Object.prototype.get;
throw new Error('fail');

Check failure on line 50 in test/parallel/test-assert-fail.js

View workflow job for this annotation

GitHub Actions / test-linux

--- stdout --- Test failure: 'Object prototype get' Location: test/parallel/test-assert-fail.js:46:1 Error: fail at TestContext.<anonymous> (/home/runner/work/node/node/node/test/parallel/test-assert-fail.js:50:9) at Test.runInAsyncScope (node:async_hooks:211:14) at Test.run (node:internal/test_runner/test:980:25) at Test.processPendingSubtests (node:internal/test_runner/test:678:18) at Test.postRun (node:internal/test_runner/test:1091:19) at Test.run (node:internal/test_runner/test:1019:12) at async Test.processPendingSubtests (node:internal/test_runner/test:678:7) Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /home/runner/work/node/node/node/test/parallel/test-assert-fail.js

Check failure on line 50 in test/parallel/test-assert-fail.js

View workflow job for this annotation

GitHub Actions / test-macOS (macos-13)

--- stdout --- Test failure: 'Object prototype get' Location: test/parallel/test-assert-fail.js:46:1 Error: fail at TestContext.<anonymous> (/Users/runner/work/node/node/node/test/parallel/test-assert-fail.js:50:9) at Test.runInAsyncScope (node:async_hooks:211:14) at Test.run (node:internal/test_runner/test:980:25) at Test.processPendingSubtests (node:internal/test_runner/test:678:18) at Test.postRun (node:internal/test_runner/test:1091:19) at Test.run (node:internal/test_runner/test:1019:12) at async Test.processPendingSubtests (node:internal/test_runner/test:678:7) Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /Users/runner/work/node/node/node/test/parallel/test-assert-fail.js

Check failure on line 50 in test/parallel/test-assert-fail.js

View workflow job for this annotation

GitHub Actions / test-macOS (macos-14)

--- stdout --- Test failure: 'Object prototype get' Location: test/parallel/test-assert-fail.js:46:1 Error: fail at TestContext.<anonymous> (/Users/runner/work/node/node/node/test/parallel/test-assert-fail.js:50:9) at Test.runInAsyncScope (node:async_hooks:211:14) at Test.run (node:internal/test_runner/test:980:25) at Test.processPendingSubtests (node:internal/test_runner/test:678:18) at Test.postRun (node:internal/test_runner/test:1091:19) at Test.run (node:internal/test_runner/test:1019:12) at async Test.processPendingSubtests (node:internal/test_runner/test:678:7) Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout /Users/runner/work/node/node/node/test/parallel/test-assert-fail.js
});
11 changes: 8 additions & 3 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@ def HasRun(self, output):

class ActionsAnnotationProgressIndicator(DotsProgressIndicator):
def AboutToRun(self, case):
case.additional_flags = case.additional_flags.copy() if hasattr(case, 'additional_flags') else []
case.additional_flags.append('--test-reporter=./test/common/test-error-reporter.js')
case.additional_flags.append('--test-reporter-destination=stdout')
pass

def GetAnnotationInfo(self, test, output):
traceback = output.stdout + output.stderr
Expand Down Expand Up @@ -1448,6 +1446,9 @@ def BuildOptions():
result.add_option("--type",
help="Type of build (simple, fips, coverage)",
default=None)
result.add_option("--error-reporter",
help="use error reporter",
default=False, action="store_true")
return result


Expand Down Expand Up @@ -1667,6 +1668,10 @@ def Main():
run_worker = join(workspace, "tools", "run-worker.js")
options.node_args.append(run_worker)

if options.error_reporter:
options.node_args.append('--test-reporter=./test/common/test-error-reporter.js')
options.node_args.append('--test-reporter-destination=stdout')

processor = GetSpecialCommandProcessor(options.special_command)

context = Context(workspace,
Expand Down
Loading