You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Grouping subtests using test suites in test.xml (#4275)
**What type of PR is this?**
Feature
**What does this PR do? Why is it needed?**
This PR makes every test function a `<testsuite>` and every subtest a
`<testcase>`. This allow us to record the start time of every test
function, because only `<testsuite>` has a timestamp attribute. This
approach is also consistent with [testify
suite](https://pkg.go.dev/github.com/stretchr/testify/suite), each of
which becomes a `<testsuite>`.
Note that in the test.xml, a test function is both a `<testsuite>` and a
`<testcase>`. It has to be a `<testcase>` because the test function
itself has its own duration that is independent of its subtests. Also,
it can have assertions outside all subtests, it can fail even all its
subtests succeed. If no subtest is used, every `<testsuite>` only has
one `<testcase>`, which is more verbose than before.
Consumers of test.xml that only read `<testcase>` are not affected by
this change. but those assuming only one `<testsuite>` will need to be
updated.
We also lose track of the duration of the whole package, but that can be
obtained from Bazel build events.
0 commit comments