Skip to content

Conversation

@michaelst
Copy link

I was running into an issue with test failures causing the report to fail to write with this error

15:38:27.110 [error] GenServer #PID<0.926.0> terminating
** (MatchError) no match of right hand side value: {:error, :badarg}
    (junit_formatter 3.4.0) lib/formatter.ex:164: JUnitFormatter.handle_suite_finished/1
    (junit_formatter 3.4.0) lib/formatter.ex:73: JUnitFormatter.handle_cast/2
    (stdlib 6.2.2) gen_server.erl:2371: :gen_server.try_handle_cast/3
    (stdlib 6.2.2) gen_server.erl:2433: :gen_server.handle_msg/6
    (stdlib 6.2.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3

The piece in the report that was causing this I traced back to

[
  ~c"<",
  ~c"error",
  [
    [~c" ", ~c"message", ~c"=\"",
     ~c"Invalid module Elixir.ExUnit.TestModule", ~c"\""]
  ],
  ~c">"
], # followed by a long binary

I'm not sure if there is a reason to treat invalid this way, but this change does allow my report to generate with the correct failure now instead of crashing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant