17 Commits

Author SHA1 Message Date
Joël Stemmer
da6551b8c0 gtr,parser/gotest: Remove gtr.Benchmark and use gtr.Test for all tests 2022-06-15 23:46:40 +01:00
Joël Stemmer
46e0aed494 gtr: Also look at failures in benchmarks when creating a package
When we encounter a failure but there was not failing test, we create a
failing dummy test in the report. This is to prevent the failure from
being overlooked.

The case where the output contained a failing benchmark was not handled
correctly, resulting in a dummy test failure being added to the report
unnecessarily.
2022-06-13 00:47:28 +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
5331b9b8d6 parser/gotest: Create output collector that preserves the line order 2022-06-08 23:01:01 +01:00
Joël Stemmer
d2480a6059 parser/gotest: Skip ID 0 when searching for existing tests or benchmarks 2022-06-08 23:01:01 +01:00
Joël Stemmer
2f7bf7c3bc parser/gotest: Set unique Test, Benchmark and Error ID's
This will be used later to collect and store output for the right tests.
2022-06-08 23:01:01 +01:00
Joël Stemmer
c87388ae59 parser/gotest,junit: Move benchmark grouping to parser/gotest package
Having multiple benchmarks for a single name is something specific to
the gotest output, so grouping benchmarks by name is not something that
belongs in the junit package.
2022-06-08 23:01:01 +01:00
Joël Stemmer
84074a188c parser/gotest: remove debugging printf from reportBuilder 2022-05-22 00:50:12 +01:00
Joël Stemmer
1b7027fde7 parser/gotest: add SubtestMode to configure how to deal with subtests 2022-05-22 00:32:17 +01:00
Joël Stemmer
6c038bc425 parser/gotest: never reset nextID in report builder to ensure unique ids 2022-05-21 23:29:24 +01:00
Joël Stemmer
01f41237f7 parser/gotest: continue with next item when we find a test or benchmark 2022-05-21 23:19:41 +01:00
Joël Stemmer
b5d2695c26 parser/gotest: return a separate bool instead of a negative id in find* 2022-05-21 22:26:00 +01:00
Joël Stemmer
f97910c4b9 parser/gotest: Make reportBuilder options private 2022-05-21 22:16:55 +01:00
Joël Stemmer
ae7e71c599 parser/gotest: rename Id -> ID 2022-05-21 18:48:07 +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
df7394c77c Fix cmp.Diff argument order in tests 2022-05-13 21:45:38 +01:00
Joël Stemmer
d84b066208 Move packages out of pkg/ 2022-04-20 19:39:05 +01:00