Commit Graph

6 Commits

Author SHA1 Message Date
Joël Stemmer
3adb6bab4b testdata: Create generate-golden.go to generate report.xml files
The testdata directory contains various inputs and the resulting
report.xml that is expected to be generated. Making changes that result
in differences in the generated XML reports requires the report.xml
files to be manually updated. This is time consuming and error prone.

The generate-golden.go script (re)generates all report.xml files in the
testdata directory from the corresponding input. This can be done by
simply running `go generate` from within the testdata directory. Make
sure the generated reports contain the changes you expected before
committing them.

As part of this change, all reports have been regenerated. The diffs in
the report.xml files are caused by the following recent changes:
- XML attributes now appear in the order as defined in the structs in
  the junit package.
- Failure and error messages are now wrapped in <![CDATA[]]>.
- Package names are no longer truncated to the last path component.
2022-03-22 22:05:23 +00:00
Joël Stemmer
817a23b10d gtr: Handle end_test events without corresponding run_test event
When running `go test` without the `-v` flag, the output may not contain
everything that we expect. For example, no output is generated for
passing tests. Even for a failing test the output does not contain a
`=== RUN` line.

Currently, this resulted in us ignoring the test result since we
couldn't find an existing test to assign this result to. We should
however handle this situation gracefully, and just assume a test exists
when only encountering a test result line.

References #109
2022-03-20 22:35:50 +00:00
Joël Stemmer
fc0a210dc9 junit: Make failures and errors required fields
Fixes #101
2022-03-20 22:35:50 +00:00
Joël Stemmer
2ece8eae1a gtr: Set hostname and timestamp fields when creating JUnit Testsuite
Fixes #117
2022-03-20 22:35:50 +00:00
Joël Stemmer
c2e4b698fc junit: Create junit package 2022-03-11 21:53:00 +00:00
Michael Lai
6315b3013b Parse package name output when test binary name is included
Sometimes, the text after "# " shows the name of the test binary
("<package>.test") in addition to the package
e.g.: "# package/name [package/name.test]".
This change ensures that the packages' build outputs are associated
correctly in this case.
2019-09-18 17:44:54 -07:00