-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Tests: Adds reporter that shows JS test errors on GitHub when executing GitHub workflows #31041
Conversation
This reverts commit a4c33b5.
Size Change: +3.11 kB (0%) Total Size: 1.47 MB
ℹ️ View Unchanged
|
There is a bug in the reporter which means we need to wait more to see it in action:
I'm waiting patiently 😄 |
Yeah, I think it's the |
Seems like we are actually generating annotations: https://github.com/WordPress/gutenberg/actions/runs/771200933 They just aren't displayed in the diff 🤔 Wonder if we're doing something wrong with regard to how we pass the filename and/or line and column... |
Ah, I see it. We're extracting the wrong line number. From my local run:
Note that we're setting
whereas the correct location would be
I'll try to fix the RegEx. |
💥 TODO:
|
This reverts commit 52a24a2.
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.
Awesome, feel free to experiment a bit more but don't let folks wait too long to see it in action 🎉
On the note of ANSI colors: I've noticed that Jest provides those as part of the items in the
However, the seem to get lost during processing in the reporter 🤔 |
I'll ignore the colors for now. I think that it's not specific to this reporter -- Jest normally uses colors to highlight test outcomes in its standard reporters, and those are apparently also lost (stripped by Jest?) in the GHA output. |
Will it work also with e2e tests? it would be more helpful there as they fail more often 😅 |
Ah, great question! I think it should, since they're also Jest-based. However, we'll need to add the reporter to the e2e tests' I'll give it a quick spin 👍 |
Pushed a few more commits, and moved the reporter to the @gziolo Care to give it another quick look if the changes I made to files in |
packages/e2e-tests/specs/editor/various/inserting-blocks.test.js
Outdated
Show resolved
Hide resolved
Awesome, thank you very much! |
Description
Try adding a Jest Reporter that produces an output format for GitHub annotations.
Based on jestjs/jest#11320 (but ported the TypeScript to plain ol' JS since I couldn't get the TS based reporter to work). Quoting that PR:
This PR is mostly meant to demo that feature; ideally, we'll be able to tweak it and merge it. If jestjs/jest#11320 gets merged, we can then consider switching to that, once there's a Jest version that includes it.
How has this been tested?
See diff view: There should be an annotation below the failing assertion.
To test locally, run
to see the GHA-specific output format. Confirm that if you omit the
GITHUB_ACTIONS
env var, you won't see that output.Screenshots
FYI @gziolo