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

gh-actions: Add action to install gotestfmt and our wrapper script #42

Merged
merged 5 commits into from
Nov 14, 2024

Conversation

adombeck
Copy link
Contributor

@adombeck adombeck commented Nov 13, 2024

The output of go test is notoriously hard to read, especially when a lot of tests are executed and a lot of output is produced. gotestfmt can hide the output of successful tests and put the output of failed tests in an expandable group.

This PR adds a custom GitHub Action which installs gotestfmt and a wrapper script which improves the output and copies it to log files, which can then be uploaded as test artifacts.

You can see an example of the produced output when a test fails in this job. A link to the artifacts of that job can be found in the "Upload test artifacts" step of that job.

Copy link
Collaborator

@didrocks didrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! This will definitively be really helpful. I have no major comments on that PR, mostly stylistic to have a coherent script style, and some questions along the lines!

@adombeck adombeck force-pushed the gotestfmt branch 5 times, most recently from 7353915 to 0aa426b Compare November 13, 2024 17:10
@adombeck adombeck requested a review from didrocks November 13, 2024 17:18
Copy link
Collaborator

@didrocks didrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all those changes! They really look good.

I only have one comment remaining to avoid GH printing this set -eu in the step, and then, we are good to go(testfmt)!

Copy link
Collaborator

@didrocks didrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Nothing remaining on my side :)

(Note: I’m unsure that was intentional, but you didn’t +1 on the comment and reask for review, but I assumed that was just forgotten, if you didn’t want to have another look yet, sorry about it)

@adombeck
Copy link
Contributor Author

(Note: I’m unsure that was intentional, but you didn’t +1 on the comment and reask for review, but I assumed that was just forgotten, if you didn’t want to have another look yet, sorry about it)

Right, sorry, I still forget re-requesting the review sometimes, I'm not used to that workflow.

The output of go test is notoriously hard to read, especially when a lot
of tests are executed and a lot of output is produced. gotestfmt can
hide the output of successful tests and put the output of failed tests
in an expandable group.

This commit adds a custom GitHub Action which installs gotestfmt and a
wrapper script which improves the output and copies it to log files,
which can then be uploaded as test artifacts.
In the output of the GitHub Actions run, the commands run for each step
are collapsed, with only the first line being shown unless it's
expanded. It's not helpful if that line is "set -eu" for all our
multi-command steps, so we add a comment to the fist line instead which
describes what the commands are doing.
@adombeck adombeck merged commit 78cb344 into main Nov 14, 2024
2 checks passed
@adombeck adombeck deleted the gotestfmt branch November 14, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants