stretchr/testify

Show a summary of failing tests within a suite

Open

#244 建立於 2015年11月20日

在 GitHub 查看
 (5 留言) (3 反應) (0 負責人)Go (25,958 star) (1,704 fork)batch import
help wantedrevisit

描述

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?

貢獻者指南

Show a summary of failing tests within a suite · stretchr/testify#244 | Good First Issue