Commit c1342f4
committed
terraform test: Include test case execution time in JUnit XML
Our currently-experimental JUnit XML output didn't previously include the
"time" attribute for test runs at all, but from testing with common JUnit
XML consumers we've learned that populating this is effectively mandatory
because otherwise software just assumes that it's zero, producing a
misleading result.
We'll now populate it based on the test runner's measure of the execution
time, assuming that the test runner actually measured it. If not, we'll
leave it omitted and thus get the same behavior as before, which in
practice means that most software will treat it as zero anyway.
Because JUnit XML output is still experimental with the goal of getting
feedback on exactly how we map the Terraform testing model onto that
Java-oriented format, this is intentionally not supported for remote test
runs in Terraform Cloud yet. It isn't really practical for Terraform Cloud
to participate in short-lived Terraform CLI experiments, because Terraform
Cloud has a different release schedule than Terraform CLI does. However,
if this experiment is successful then we will eventually need to find a
way to plumb this additional information through the JSON logs and ensure
that it arrives in the locally-generated JUnit XML output.1 parent 397ea6d commit c1342f4
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
889 | 902 | | |
890 | 903 | | |
891 | 904 | | |
| |||
898 | 911 | | |
899 | 912 | | |
900 | 913 | | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
901 | 917 | | |
902 | 918 | | |
903 | 919 | | |
| |||
0 commit comments