enhanced Go test output (quiet by default, print package path)#511
Open
pohly wants to merge 1 commit intoonsi:masterfrom
Open
enhanced Go test output (quiet by default, print package path)#511pohly wants to merge 1 commit intoonsi:masterfrom
pohly wants to merge 1 commit intoonsi:masterfrom
Conversation
"ginkgo" can replace "go test" as test runner also for normal Go tests, but the output was different: - tests were always run with -test.v and thus produced output also on success - there was no indication of which test produced the output Now the output behavior is closer to that of "go test": - tests run in verbose mode only when "ginkgo -v" is used - after each test, a line with "ok/FAIL <test path>" is printed That line is not quite the same as in "go test", which prints the import path, but close enough. That line is important when running in quite mode, because without it one would not be able to tell what tests were run. Even in verbose mode the output could be ambiguous (for example, when different packages happen to contain the same test). Example: $ go test ./pkg/log ./pkg/log/testlog ok github.com/foo/bar/pkg/log 0.005s --- FAIL: TestOutput2 (0.00s) testlog_test.go:40: INFO TestOutput2 testlog_test.go:42: was asked to fail FAIL FAIL github.com/foo/bar/pkg/log/testlog 1.417s $ ginkgo ./pkg/log ./pkg/log/testlog PASS ok ./pkg/log --- FAIL: TestOutput2 (0.00s) testlog_test.go:40: INFO TestOutput2 testlog_test.go:42: was asked to fail FAIL FAIL ./pkg/log/testlog Ginkgo ran 2 suites in 2.145256459s Test Suite Failed Fixes: onsi#508
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"ginkgo" can replace "go test" as test runner also for normal Go
tests, but the output was different:
also on success
Now the output behavior is closer to that of "go test":
printed
That line is not quite the same as in "go test", which prints the
import path, but close enough. That line is important when running in
quite mode, because without it one would not be able to tell what
tests were run. Even in verbose mode the output could be
ambiguous (for example, when different packages happen to contain the
same test).
Example:
$ go test ./pkg/log ./pkg/log/testlog
ok github.com/foo/bar/pkg/log 0.005s
--- FAIL: TestOutput2 (0.00s)
testlog_test.go:40: INFO TestOutput2
testlog_test.go:42: was asked to fail
FAIL
FAIL github.com/foo/bar/pkg/log/testlog 1.417s
$ ginkgo ./pkg/log ./pkg/log/testlog
PASS
ok ./pkg/log
--- FAIL: TestOutput2 (0.00s)
testlog_test.go:40: INFO TestOutput2
testlog_test.go:42: was asked to fail
FAIL
FAIL ./pkg/log/testlog
Ginkgo ran 2 suites in 2.145256459s
Test Suite Failed
Fixes: #508