tools: improve node:test output when running in github actions#49129
tools: improve node:test output when running in github actions#49129MoLow wants to merge 3 commits intonodejs:mainfrom
node:test output when running in github actions#49129Conversation
|
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 |
| 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.
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.
I guess we can do that in a follow-up. perhaps only in the asan job
| 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.
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.
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
GeoffreyBooth
left a comment
There was a problem hiding this comment.
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.
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.
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 |
aduh95
left a comment
There was a problem hiding this comment.
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