stretchr/testify

Show a summary of failing tests within a suite

Open

#244 ouverte le 20 nov. 2015

Voir sur GitHub
 (5 commentaires) (3 réactions) (0 assignés)Go (1 704 forks)batch import
help wantedrevisit

Métriques du dépôt

Stars
 (25 958 stars)
Métriques de merge PR
 (Merge moyen 6j 15h) (2 PRs mergées en 30 j)

Description

Currently, if some but not all tests within a suite fail, this is opaque to go get. Thus, all tests within a failing suite are printed. This can make it hard to figure out which test has failed without carefully scrolling, searching or grepping through a test result.

A simple improvement would be to display a Suite level summary of the tests. For example, instead of displaying only "--FAIL: TestMySuite (0.00)" at the end a failing suite, how about:

--- FAIL: TestMySuite (0.00s)
FAIL     github.com/brycefisher/my-project/my-package MySuite -- TestWithinSuite
FAIL     github.com/brycefisher/my-project/my-package MySuite -- TestWithinSuite2

Rerun the failing tests with:
go test github.com/brycefisher/my-project/my-package -run=TestMySuite -m=TestWithinSuite && \
go test github.com/brycefisher/my-project/my-package -run=TestMySuite -m=TestWithinSuite2

This would at a glance make it clear which specific tests failed, and make it easy to run just the failing tests over and over.

I'm not super familiar with the internals of mockery and suites, but I imagine that dynamically looking up the package and determining the suite and test are not super challening.

Thoughts?

Guide contributeur