Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lexrj opened this issue Jul 15, 2021 · 0 comments
Open
Labels
bug Something isn't working

Comments

@lexrj
Copy link

lexrj commented Jul 15, 2021

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)

@lexrj lexrj changed the title If a test exits, go-opine fails to report on the entire file If a test calls os.Exit, go-opine fails to report on the entire file Jul 15, 2021
@cnmcavoy cnmcavoy added the bug Something isn't working label Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants