Skip to content

If a test calls os.Exit, go-opine fails to report on the entire file #2

@lexrj

Description

@lexrj

Minimal example:

func Test_exits(t *testing.T) {
	require.NoError(t, errors.New("Test"))
	os.Exit(1)
}

Adding any other tests to the suite shows that the entire file is excluded from the test report, while go test -race ./... will still report them, and also throw a moderately useful error including the test name:

--- FAIL: Test_exits (0.00s)
    daemon_test.go:12:
        	Error Trace:	daemon_test.go:12
        	Error:      	Received unexpected error:
        	            	Test
        	Test:       	Test_exits
flag provided but not defined: -test.testlogfile

(and then prints the usage)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions