Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Jump directly to failure in gotestfmt #13180

Closed
wants to merge 2 commits into from
Closed

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Jul 5, 2022

Now that we are seeing more complement failures (c.f. #13161) I'm more frequently encountering the following behaviour.

  1. Click on a complement run to investigate the logs, e.g. here.
  2. GitHub automatically scrolls to the first "error message", where "error message" means an error annotation of this form.
  3. Normally the only such error is " Error: Process completed with exit code 1." from calling complement.sh ... | gotestfmt. That error is automatically generated by github when we run a shell command and appears at the bottom of the output.
  4. This is infuritating because the log you want to see is the first test failure! That means we have to scroll up a load which is also infuriating, and means that Sort failing jobs in Complement CI to the top of the logs to make them easier to read. #13057 wasn't quite as useful as we'd hoped.

Fix this by tweaking go test fmt's outputter to output the special GHA error message.

To prove this works:

  • https://github.com/matrix-org/synapse/runs/7303102301?check_suite_focus=true is a run against a complement branch with a small test suite that always includes one failure. This shows that we still generate sensible gotestfmt output. So this can't be any worse.
  • TODO: I've deleted that branch and will try to generate a run with failures that demonstrates the scrolling behaviour.

The annotations could probably be made more precise/better/descriptive. But this is a quick drive by and I've already spent enough time on this.

@DMRobertson DMRobertson marked this pull request as ready for review July 12, 2022 14:01
@DMRobertson DMRobertson requested a review from a team as a code owner July 12, 2022 14:01
@DMRobertson
Copy link
Contributor Author

Bugger. https://github.com/matrix-org/synapse/runs/7305162776?check_suite_focus=true demonstrates that this prints out what I expect but still scrolls to the bottom.

@DMRobertson DMRobertson marked this pull request as draft July 13, 2022 18:49
@DMRobertson
Copy link
Contributor Author

I'm going to drop this until I get sufficiently frustrated to take another look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant