7 Commits

Author SHA1 Message Date
Joël Stemmer
f1ad02b733 junit: Use the standard duration formatting for benchmark durations
Benchmark durations were originally formatted with higher precision
because they contained just the NsPerOp field. Now that we're
approximating the total duration they are more accurate and don't need
as many decimals.
2022-06-12 23:02:01 +01:00
Joël Stemmer
1d905e0b1c gtr: Improve accuracy of benchmark duration calculation
The NsPerOp was previously casted to a time.Duration (int64) before
multiplying it with the number of iterations. This has been fixed by
doing the casting after the multiplication. The resulting duration
should be a bit more accurate.
2022-06-12 22:56:04 +01:00
Joël Stemmer
cb055227b7 parser/gotest: Improve gotest output handling
The reportBuilder has been updated to use the ordered output collector
to keep track of go test output. This makes it possible to include
benchmark output in the generated report and makes sure that output is
preserved when deleting subtest parents from the report.
2022-06-08 23:01:01 +01:00
Joël Stemmer
9bc291d7ca junit: Make Testsuites.ID a required field 2022-05-21 14:28:22 +01:00
Joël Stemmer
d2592490b6 junit: Include output in JUnit report for successful tests and benchmarks 2022-05-14 23:36:18 +01:00
Joël Stemmer
a4c479dbbb gtr: Reset builder state after the end of a test or benchmark
The consequence of this is that any output emitted after the test or
benchmark result, will no longer belong to the last test. Instead it
will be appended to the global log. This is necessary to correctly
attribute output to the correct test or benchmark, for example in cases
where both tests and benchmarks appear.

In the past, Go test output printed test logs after the test result.
However, from Go 1.14 this behaviour was changed and test logs are now
printed before the test result.

With this commit, we effectively no longer support the old behaviour in
Go1.13 and earlier. The output will still appear in the generated
report, however it will no longer belong to the correct test.
2022-05-14 23:25:41 +01:00
Joël Stemmer
d63613f07a Add testdata for json go test output 2022-04-01 00:58:11 +01:00