gotestyourself / gotestyourself/gotestsum

Display build/setup failures output

Open
#500 1 comment 5 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.7k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

gotestsum is hiding the output when the test code cannot be built, which can make debugging harder.
For example:
```
package main

import (
"fmt"
"testing"

"github.com/stretchr/testify/require"
)

//go:embed toto.txt
var toto string

func TestHello(t *testing.T) {
fmt.Println("Hello, World!")
require.True(t, true)
}
```
Cannot be built because `embed` is not imported properly. If you try to run that test with `go test -v` you will get:
```
# testgo [testgo.test]
./main_test.go:10:3: go:embed only allowed in Go files that import "embed"
FAIL testgo [build failed]
```
with `gotestsum --format standard-verbose`:
```
FAIL testgo [build failed]

=== Failed
=== FAIL: . (0.00s)
FAIL testgo [build failed]

DONE 0 tests, 1 failure in 0.348s
```
Which is hard to debug. Would be nice to have a flag that allows us to have build error displayed, and not only `[build failed]`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the example with gotestsum --format standard-verbose and compare its output with go test -v. Identify the command-line flag handling and output path involved; done means a user can opt in to seeing the compiler's build diagnostics instead of only [build failed].

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.