-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
tools: improve node:test
output when running in github actions
#49129
Conversation
Review requested:
|
@MoLow This seems to have not worked? /opt/hostedtoolcache/Python/3.11.4/x64/bin/python3 tools/test.py -p tap --logfile test.tap \
--mode=release --flaky-tests=keep_retrying \
-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' -t 300 --measure-flakiness 9 default pummel addons js-native-api node-api benchmark
Running 4010 tests
.................................................. |
@atlowChemi this will only change the behavior in case of failed tests |
@@ -94,4 +94,4 @@ jobs: | |||
- name: Test | |||
run: | | |||
cd $TAR_DIR | |||
make run-ci -j2 V=1 TEST_CI_ARGS="-p dots --measure-flakiness 9" | |||
make run-ci -j2 V=1 TEST_CI_ARGS="-p dots --node-args='--test-reporter=spec' --measure-flakiness 9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an improvement in terms of the amount of output we see from failed tests, which should help with debugging.
There is also the issue of the asan CI job truncating output. Since node:test
is never used as the main test runner, a possible next step to address that issue could be to create a custom reporter in tools/
that only outputs the test failures and diagnostic messages. It could basically be a slimmed down version of the spec reporter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can do that in a follow-up. perhaps only in the asan job
@@ -94,4 +94,4 @@ jobs: | |||
- name: Test | |||
run: | | |||
cd $TAR_DIR | |||
make run-ci -j2 V=1 TEST_CI_ARGS="-p dots --measure-flakiness 9" | |||
make run-ci -j2 V=1 TEST_CI_ARGS="-p dots --node-args='--test-reporter=spec' --measure-flakiness 9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the CI ran fine so I guess there is no issue, but are we sure this won't impact any of the tests that expect different reporters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no issue. tests that look at reporters (e.g snapshot tests, exit code tests etc) always spawn a child and control the env vars and flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don’t we usually add dependencies in a dedicated PR? Though this seems isolated enough that I wouldn’t object in this case.
It would be nice to see an example of the output of a failed test/job using this PR.
def AboutToRun(self, case): | ||
if not hasattr(case, 'additional_flags'): | ||
case.additional_flags = [] | ||
case.additional_flags.append('--test-reporter=./tools/github_reporter/index.js') | ||
case.additional_flags.append('--test-reporter-destination=stdout') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand this correctly, this is adding two additional flags to all the tests that run. This feels worrisome, because as a test author I’d expect the flags I define at the top of the test file to be the only flags that are used; I can imagine issues with process.argv
and so on. Could these be defined via environment variables instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only the case in github actions, within jenkins or locally the flags wont be added.
the only way to add this via an environment variable is with NODE_OPTIONS
Adding the |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM for tools/github_reporter/index.js
, LGTM for the rest :)
Landed in 802c52f...9cc7327 |
PR-URL: nodejs#49129 Refs: nodejs#49120 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#49129 Refs: nodejs#49120 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#49129 Refs: nodejs#49120 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#49129 Refs: nodejs#49120 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#49129 Refs: nodejs#49120 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#49129 Refs: nodejs#49120 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Refs: #49120