feat: use gotestsum for unit tests when available#9759
feat: use gotestsum for unit tests when available#9759vdemeester wants to merge 1 commit intotektoncd:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/lgtm |
|
@chmouel: changing LGTM is restricted to collaborators DetailsIn response to this:
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 |
There was a problem hiding this comment.
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.
c0ec788 to
0ea3b7c
Compare
Changes
Use
gotestsuminmake test-unitwhen available, falling back togo testotherwise. This follows the same pattern as pipelines-as-code.gotestsumprovides improved test output formatting. The default format istestdoxwhich gives a readable sentence for each test:The format can be overridden via the
DEFAULT_GOTESTSUM_FORMATvariable:Available formats:
dotsdots-v2pkgnamepkgname-and-test-failstestnametestdoxgithub-actionsstandard-quietgo testformatstandard-verbosego test -vformatDEVELOPMENT.mdis updated to documentgotestsumas an optional tool and describe the available formats.Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes