Skip to content

feat: run tests via gotestsum to report the number of tests per testing type - #437

Merged
ergousha merged 1 commit into
mainfrom
feat/gotestsum
Jul 30, 2026
Merged

feat: run tests via gotestsum to report the number of tests per testing type#437
ergousha merged 1 commit into
mainfrom
feat/gotestsum

Conversation

@ergousha

Copy link
Copy Markdown
Contributor

Closes #301.

What

Runs all test* tasks through gotestsum instead of plain go test, so every run ends with a summary line such as:

DONE 42 tests in 12.345s

Because each testing type (unit, integration, component, e2e) already runs as its own task/matrix job, this yields the per-type test counts asked for in #301.

How

  • build/task.yml
    • New vars: GOTESTSUM_BIN, GOTESTSUM_ENABLED (default true), GOTESTSUM_FORMAT (default testname), GOTESTSUM_VERSION.
    • New gotestsum-install task, following the existing gta-install/osv-scanner-install pattern. It is a no-op when GOTESTSUM_ENABLED is false.
    • The test task now picks gotestsum --format <format> -- or go test and passes the existing flags unchanged.
  • scripts/package-version-updater.sh - registers GOTESTSUM_VERSION so the weekly updater keeps it current.
  • README.md / CLAUDE.md - document the new override variables.

Opting out

includes:
  remote:
    taskfile: ...
    vars:
      GOTESTSUM_ENABLED: "false"

Verified locally

  • task remote:test-cicd on a scratch module: DONE 3 tests in 1.374s.
  • Failing test still fails the task (exit code propagates through gotestsum).
  • task remote:coverage unaffected; -coverprofile is passed through and the threshold check still works.
  • GOTESTSUM_ENABLED=false falls back to the previous go test output.
  • The taskfile-sorted-units and taskfile-without-empty-lines checks pass.

Out of scope

Aggregating the four counts into a single cross-job summary (artifact upload + $GITHUB_STEP_SUMMARY) is deliberately left out; it can follow up if there is demand.

@ergousha
ergousha merged commit 383e2e2 into main Jul 30, 2026
12 checks passed
@ergousha
ergousha deleted the feat/gotestsum branch July 30, 2026 15:23
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.

gotestsum

2 participants