-
Notifications
You must be signed in to change notification settings - Fork 97
feat: add gotestsum to workflows #1257
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
feat: add gotestsum to workflows #1257
Conversation
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.
Pull Request Overview
This PR integrates gotestsum into the test workflow to enhance test reporting capabilities by generating JUnit XML output and providing test summaries.
- Adds gotestsum installation to the tooling setup script
- Replaces all
go test
commands withgotestsum
equivalents that generate JUnit XML output - Adds test summary steps using the test-summary GitHub Action for better visibility of test results
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
.github/workflows/scripts/download-tooling.sh | Installs gotestsum tool via go install |
.github/workflows/build.yml | Replaces go test commands with gotestsum and adds test summary steps |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -13,3 +13,5 @@ rm buildkit.tar.gz | |||
sudo apt-get update | |||
sudo apt-get install -y podman | |||
systemctl --user enable --now podman.socket || true | |||
|
|||
go install gotest.tools/gotestsum@latest |
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.
Using @latest for production workflows can lead to unexpected breakages when new versions are released. Consider pinning to a specific version like @v1.11.0 for reproducible builds.
go install gotest.tools/gotestsum@latest | |
go install gotest.tools/gotestsum@v1.11.0 |
Copilot uses AI. Check for mistakes.
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 agree with this, otherwise looks good to me!
@@ -141,7 +141,11 @@ jobs: | |||
run: | | |||
set -eu -o pipefail | |||
. .github/workflows/scripts/buildkitenvs/${{ matrix.buildkit_mode}} | |||
go test -v ./integration/singlearch --addr="${COPA_BUILDKIT_ADDR}" --copa="$(pwd)/copa" -timeout 0 --report-file | |||
gotestsum --format testname --junitfile test-results.xml -- ./integration/singlearch --addr="${COPA_BUILDKIT_ADDR}" --copa="$(pwd)/copa" -timeout 0 --report-file | |||
- name: Test Summary |
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.
The test summary step should include a condition to run even if the test step fails, otherwise test results won't be reported for failed tests. Add if: always()
to ensure the summary runs regardless of test outcome.
- name: Test Summary | |
- name: Test Summary | |
if: always() |
Copilot uses AI. Check for mistakes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1257 +/- ##
=======================================
Coverage 43.03% 43.03%
=======================================
Files 35 35
Lines 4143 4143
=======================================
Hits 1783 1783
Misses 2228 2228
Partials 132 132 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
55efa53
to
ad7256e
Compare
Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
ad7256e
to
c54b049
Compare
Adds gotestsum to the test suite
Closes #1255