Skip to content

Display build/setup failures output #500

@KevinFairise2

Description

@KevinFairise2

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions