Show a summary of failing tests within a suite

Open
#244 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
go
Domain
testing-qa

Research direction

Start by tracing how testify suites are reported during go test, especially the suite and test names shown when a suite fails. Compare the current output with the proposed summary and rerun commands in the issue. Done means failed tests are listed individually and each can be rerun without scanning the full suite output.

Written by the indexing model from the issue text.

Description

help wanted revisit

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?

Dominant language
Go
Stars
26.2k
Forks
1.9k
Avg merge
2d 4h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stretchr/testify

All issues in stretchr/testify

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.