gotestyourself / gotestyourself/gotestsum

Add flag to always return success status even when there are failed tests

Open
#296 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.7k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

When running tests as a part of the CI process, it's critical that the test step will always return a success status so that the process can continue and just present tests results report. At the moment gotestsum returns non-zero status and causes our build to fail.
On commandline it looks like this:
```
➜ blink git:(xxx) ✗ gotestsum -- ./pkg/errors/...
✖ pkg/errors (445ms)

=== Failed
=== FAIL: pkg/errors TestIsDuplicateKeyError/not_duplicate_key_error_1 (0.00s)
errors_test.go:127: IsSQLError() = false, want true
--- FAIL: TestIsDuplicateKeyError/not_duplicate_key_error_1 (0.00s)

=== FAIL: pkg/errors TestIsDuplicateKeyError (0.00s)

DONE 18 tests, 2 failures in 1.079s
➜ blink git:(xxx) ✗ echo $?
1
```
At the moment I have no choice but add `|| true` at the end of the command which is obviously bad practice - if there is a real failure (not test failure), I won't be able to catch it.
Please add a flag that will cause gotestsum to ignore test fails, I didn't find one in the documentation..

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with gotestsum's command-line flag definitions and the test-runner exit-status handling, then run the command shown against the pkg/errors tests. Done means the new flag allows test failures without masking other command failures, with coverage for the resulting status behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ci-cd, cli, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.