Skip to content

Conversation

robert-cronin
Copy link
Contributor

Adds gotestsum to the test suite

Closes #1255

@robert-cronin robert-cronin self-assigned this Aug 15, 2025
@Copilot Copilot AI review requested due to automatic review settings August 15, 2025 03:05
@robert-cronin robert-cronin added the enhancement New feature or request label Aug 15, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 with gotestsum 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
Copy link
Preview

Copilot AI Aug 15, 2025

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.

Suggested change
go install gotest.tools/gotestsum@latest
go install gotest.tools/gotestsum@v1.11.0

Copilot uses AI. Check for mistakes.

Copy link
Contributor

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
Copy link
Preview

Copilot AI Aug 15, 2025

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.

Suggested change
- name: Test Summary
- name: Test Summary
if: always()

Copilot uses AI. Check for mistakes.

Copy link

codecov bot commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.03%. Comparing base (32d19f4) to head (c54b049).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robert-cronin robert-cronin changed the title Add gotestsum to workflows feat: add gotestsum to workflows Aug 15, 2025
Signed-off-by: robert-cronin <robert.owen.cronin@gmail.com>
@robert-cronin robert-cronin merged commit 825451c into project-copacetic:main Aug 18, 2025
29 checks passed
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Copacetic Workboard Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[REQ] Add gotestsum for easier workflow debugging
2 participants