victorolinasc / junit-formatter

A JUnit XML report exporter for Elixir's ExUnit
https://hexdocs.pm/junit_formatter/
Apache License 2.0
111 stars 37 forks source link

fixes missing folder error #23

Closed philippneugebauer closed 7 years ago

philippneugebauer commented 7 years ago

fixes the following error which occurs when the folder to the output file does not exist

21:16:57.501 [error] GenEvent handler JUnitFormatter installed in #PID<0.275.0> terminating
** (File.Error) could not open "tmp/report_file_test.xml": illegal operation on a directory
    (elixir) lib/file.ex:1068: File.open!/2
    (junit_formatter) lib/formatter.ex:72: JUnitFormatter.handle_event/2
    (stdlib) gen_event.erl:533: :gen_event.server_update/4
    (stdlib) gen_event.erl:515: :gen_event.server_notify/4
    (stdlib) gen_event.erl:256: :gen_event.handle_msg/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.1%) to 92.453% when pulling b443e6251c26f831223d7079209eb1efe0dead4b on philippneugebauer:master into 2a1bad963a05dcace4a9ad04314994e25ad27567 on victorolinasc:master.

cs-victor-nascimento commented 7 years ago

This was intentional. I don't believe we should create a folder outside the projects build directory automatically. This can lead to all sorts of problems like leaving files in the system even with mix clean.

I believe that if someone is setting a custom directory for the report it should exist before running the tests.

cs-victor-nascimento commented 7 years ago

I'll close this one as this is not the intended behavior. Please feel free to create an issue to discuss this more.