Skip to content

feat: use gotestsum for unit tests when available#9759

Open
vdemeester wants to merge 1 commit intotektoncd:mainfrom
vdemeester:feat/gotestsum-support
Open

feat: use gotestsum for unit tests when available#9759
vdemeester wants to merge 1 commit intotektoncd:mainfrom
vdemeester:feat/gotestsum-support

Conversation

@vdemeester
Copy link
Copy Markdown
Member

Changes

Use gotestsum in make test-unit when available, falling back to go test otherwise. This follows the same pattern as pipelines-as-code.

gotestsum provides improved test output formatting. The default format is testdox which gives a readable sentence for each test:

 ✓ Workspace binding validate valid (0.00s)
 ✓ Workspace binding validate invalid (0.00s)

DONE 1248 tests in 0.203s

The format can be overridden via the DEFAULT_GOTESTSUM_FORMAT variable:

make test-unit DEFAULT_GOTESTSUM_FORMAT=pkgname

Available formats:

Format Description
dots Print a character for each test
dots-v2 Dots format, one package per line
pkgname Print a line for each package (gotestsum default)
pkgname-and-test-fails Line per package and failed test output
testname Print a line for each test and package
testdox Print a sentence for each test (Makefile default)
github-actions testname with GitHub Actions log grouping
standard-quiet Standard go test format
standard-verbose Standard go test -v format

DEVELOPMENT.md is updated to document gotestsum as an optional tool and describe the available formats.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • pre-commit Passed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Apr 10, 2026
@tekton-robot tekton-robot requested review from khrm and twoGiants April 10, 2026 09:57
@tekton-robot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from vdemeester after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 10, 2026
@chmouel
Copy link
Copy Markdown
Member

chmouel commented Apr 10, 2026

/lgtm

@tekton-robot
Copy link
Copy Markdown
Collaborator

@chmouel: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

make test-unit

# Override the output format
make test-unit DEFAULT_GOTESTSUM_FORMAT=pkgname
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

or add it to your .envrc as export DEFAULT_GOTESTSUM_FORMAT=foo to make it permanent

Use gotestsum in 'make test-unit' when available, falling back to
'go test' otherwise. This follows the same pattern as pipelines-as-code.

gotestsum provides improved test output formatting. The default format
is 'testdox'. The format can be overridden via DEFAULT_GOTESTSUM_FORMAT
variable or set permanently in .envrc.

DEVELOPMENT.md is updated to document gotestsum as an optional tool
and describe the available formats.
@vdemeester vdemeester force-pushed the feat/gotestsum-support branch from c0ec788 to 0ea3b7c Compare April 10, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants