Elixir junit_formatter output not showing time or failures in UI

I’m using the junit-formatter Elixir package to produce $CIRCLE_TEST_REPORTS/test-junit-report.xml, which CircleCI does use to properly show that there are 30 tests, but when there are failures reported by mix test

  1) test changeset with required only attributes (InterpreterServer.ProfileTest)
     test/models/profile_test.exs:20
     Expected false or nil, got true
     code: changeset.valid?()
     stacktrace:
       test/models/profile_test.exs:22

Finished in 1.3 seconds (0.9s on load, 0.3s on tests)
30 tests, 1 failure

it does not show up in the CircleCI UI. It says “Your build ran 30 tests in unknown with 0 failures.”. I assume this is a problem with xml format junit_formatter is outputing so that CircleCI doesn’t understand it exactly. Can someone with knowledge of CircleCI’s parser look at the xml and tell me what’s wrong?

Seems like we are looking for the failure key (instead of failed as in this case). Could you please check if replacing failed with failure helps?

1 Like

The change from failed to failure for the tag worked, but I still get the time as “unknown”: “Your build ran 30 tests in unknown with 1 failure.” in https://circleci.com/gh/C-S-D/interpreter-server/82.

What tag/attribute is it looking for time? The xml already has a time attribute on the testcase and testsuite tags.

Could you please save the xml file into a subdirectory in $CIRCLE_TEST_REPORTS? The unknown identifier will be replaced with the name of the subdirectory, e.g, if the tests are placed into $CIRCLE_TEST_REPORTS/Elixir/report.xml, the time will be shown as Elixir instead of unknown in the UI.

1 Like

That worked.

Thanks for all your help. Now I just need to get the change accepted upstream in junit_formatter. :wink:

Here’s the PR to get the changed merged to junit_formatter if anyone needs this later.

2 Likes