What tools should be used to analyze `terraform test -junit-xml=FILE.xml` FILE.xml?

I tried to plug this file into Jenkins junit("FILE.xml") but Jenkins could not recognize it (null pointer exception), I opened the XML file and I saw that it lacks many tag attributes that are normally found on other JUnit XML report files.

So how this file should be interpreted?

Hi @andresvia,

The goal is indeed to be parsed with typical software like you tried, but it sounds like the Jenkins parser isn’t very robust and so it crashes when given a file that lacks some element that it assumes will always be present.

Since the Terraform language isn’t structured the same way as Java JUnit the shape of the test results isn’t quite the same either, but we did our best to map to the JUnit model as closely as we could.

This format is not properly specified and so unfortunately the only path here is to gradually learn about the expectations of each individual parsing implementation and keep tweaking until it contains enough information to please all of them. Clearly we will need to learn more about what the Jenkins parser is assuming here and adjust the XML format in the next iteration of the experiment to meet those assumptions.

In the meantime, it would be helpful if you would open a bug report issue in the main Terraform GitHub repository with as much detail as you have about exactly what error message you saw in Jenkins, which version of Jenkins (and any relevant plugins) you are using, and what parts of the XML format you noticed seem to be obviously missing. We can then try to reproduce with a similar version of Jenkins and plugins and hopefully then iterate until we find an input structure that it will accept.


1 Like

@apparentlymart, it makes sense, thanks!