0
0
Fork 0
mirror of https://codeberg.org/forgejo/docs.git synced 2024-11-21 17:36:59 -05:00

Document gotestsum use

Depends-On: https://codeberg.org/forgejo/forgejo/pulls/5249
This commit is contained in:
Radosław Piliszek 2024-09-29 11:21:28 +02:00 committed by Otto
parent 8418b8bd50
commit bf81d30d6e

View file

@ -172,3 +172,20 @@ The exact test steps must be documented in the description of the pull request.
Changes that are associated with manual tests must be labeled Changes that are associated with manual tests must be labeled
["test/manual"](https://codeberg.org/forgejo/forgejo/issues?labels=201028). ["test/manual"](https://codeberg.org/forgejo/forgejo/issues?labels=201028).
## Using gotestsum for summaries
By default, the `make` targets use the built-in `go test` command.
However, it does not produce clear summaries of test results
which are useful for understanding quickly the extent of failures.
The provided `Makefile` supports switching to [`gotestsum`](https://github.com/gotestyourself/gotestsum)
using `USE_GOTESTSUM=yes` while running tests, for example:
```sh
USE_GOTESTSUM=yes make test
```
`gotestsum` behaves like the default `go test` except it reformats the test results
so that they are clearer for human interpreation and include a helpful summary.
You need to have `gotestsum` installed (see the link above) to use it as it does not come built-in unlike `go test`.