test2junit icon indicating copy to clipboard operation
test2junit copied to clipboard

Errors happening in test reporter break generated XML files.

Open kamituel opened this issue 7 years ago • 1 comments

We're using a custom test reporter (by binding to clojure.test/report). That reporter does plenty of stuff, i.e. it sets up fixtures, logs user in, and so on. If an error happens there - before the test case runs - test2junit will produce a file like this:

<?xml version="1.0" encoding="UTF-8"?>

This happens on 1.2.2 as well as 1.3.3. It works badly with our CI (Attlasian Bamboo) as this XML file doesn't flag the build as failed. So it's possible for a test to fail, and the build be green.

This can be fixed using a (try ...) block, see here: https://github.com/kamituel/test2junit/blob/v0.2.2/src/test2junit/junit.clj#L235

I did fix it on 1.2.2 and published our custom artifacts as this is the version we're using, but I didn't open a PR against master because I needed a fix quickly, and I'm not able to bump dependency to 1.3.3 because of issue #16. But let me know if you consider this fix viable - I'll open a PR then.

kamituel avatar Feb 26 '18 09:02 kamituel

As already commented in the other issue, I could not reply due to unforeseen private circumstances. I hope that I can come up with a more "on topic" reply approximately next week.

Thanks for your patience and cheers,

Ruediger

ruedigergad avatar Mar 14 '18 13:03 ruedigergad