-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tester: differentiate expected output by golang version (#3087)
Fixes #3082. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
- Loading branch information
Showing
3 changed files
with
119 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// +build !go1.16 | ||
|
||
// The outputs here change with Go 1.16, see | ||
// https://github.com/golang/go/commit/afe7c8d0b25f26f0abd749ca52c7e1e7dfdee8cb | ||
// But since we've been using 1.14 by the time these split-off fixtures | ||
// were introduced, the filename mentions go1.14. | ||
|
||
package tester | ||
|
||
const fixtureReporterVerboseBenchmark = `FAILURES | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_corge: FAIL (0s) | ||
SUMMARY | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_baz 1000 123 ns/op | ||
data.foo.bar.test_qux: ERROR (0s) | ||
some err | ||
data.foo.bar.test_corge: FAIL (0s) | ||
-------------------------------------------------------------------------------- | ||
PASS: 1/3 | ||
FAIL: 1/3 | ||
ERROR: 1/3 | ||
` | ||
|
||
const fixtureReporterVerboseBenchmarkShowAllocations = `FAILURES | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_corge: FAIL (0s) | ||
SUMMARY | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_baz 1000 123 ns/op 123 timer_rego_query_eval_ns/op 91 B/op 0 allocs/op | ||
data.foo.bar.test_qux: ERROR (0s) | ||
some err | ||
data.foo.bar.test_corge: FAIL (0s) | ||
-------------------------------------------------------------------------------- | ||
PASS: 1/3 | ||
FAIL: 1/3 | ||
ERROR: 1/3 | ||
` | ||
|
||
const fixtureReporterVerboseBenchmarkShowAllocationsGoBenchFormat = `FAILURES | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_corge: FAIL (0s) | ||
SUMMARY | ||
-------------------------------------------------------------------------------- | ||
BenchmarkDataFooBarTestBaz 1000 123 ns/op 123 timer_rego_query_eval_ns/op 91 B/op 0 allocs/op | ||
data.foo.bar.test_qux: ERROR (0s) | ||
some err | ||
data.foo.bar.test_corge: FAIL (0s) | ||
-------------------------------------------------------------------------------- | ||
PASS: 1/3 | ||
FAIL: 1/3 | ||
ERROR: 1/3 | ||
` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// +build go1.16 | ||
|
||
// See https://golang.org/cmd/go/#hdr-Build_constraints, | ||
// this build constraint will match go 1.16 onwards. | ||
|
||
package tester | ||
|
||
const fixtureReporterVerboseBenchmark = `FAILURES | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_corge: FAIL (0s) | ||
SUMMARY | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_baz 1000 123.0 ns/op | ||
data.foo.bar.test_qux: ERROR (0s) | ||
some err | ||
data.foo.bar.test_corge: FAIL (0s) | ||
-------------------------------------------------------------------------------- | ||
PASS: 1/3 | ||
FAIL: 1/3 | ||
ERROR: 1/3 | ||
` | ||
|
||
const fixtureReporterVerboseBenchmarkShowAllocations = `FAILURES | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_corge: FAIL (0s) | ||
SUMMARY | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_baz 1000 123.0 ns/op 123.0 timer_rego_query_eval_ns/op 91 B/op 0 allocs/op | ||
data.foo.bar.test_qux: ERROR (0s) | ||
some err | ||
data.foo.bar.test_corge: FAIL (0s) | ||
-------------------------------------------------------------------------------- | ||
PASS: 1/3 | ||
FAIL: 1/3 | ||
ERROR: 1/3 | ||
` | ||
|
||
const fixtureReporterVerboseBenchmarkShowAllocationsGoBenchFormat = `FAILURES | ||
-------------------------------------------------------------------------------- | ||
data.foo.bar.test_corge: FAIL (0s) | ||
SUMMARY | ||
-------------------------------------------------------------------------------- | ||
BenchmarkDataFooBarTestBaz 1000 123.0 ns/op 123.0 timer_rego_query_eval_ns/op 91 B/op 0 allocs/op | ||
data.foo.bar.test_qux: ERROR (0s) | ||
some err | ||
data.foo.bar.test_corge: FAIL (0s) | ||
-------------------------------------------------------------------------------- | ||
PASS: 1/3 | ||
FAIL: 1/3 | ||
ERROR: 1/3 | ||
` |
This file contains 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