alfert / coverex

Coverage Reports for Elixir
Other
101 stars 26 forks source link

Crash in tests with Docker Elixir Image (Elixir 1.3.1 & Erlang 19) #32

Closed ephe-meral closed 8 years ago

ephe-meral commented 8 years ago

I'm experiencing issues with coverex in a project using the official elixir docker image.

OS is Debian Jessie Elixir version is 1.3.1 Erlang version is 19

The tests are run by the CircleCI bot within the Docker environment, but before they are executed, they crash with the following error report(s):

Coverex compiling modules ... 
compile_path is "/myproject.git/_build/test/lib/myproject/ebin"
Options are: [output: "cover", tool: Coverex.Task]

09:54:29.254 [error] Process #PID<0.338.0> raised an exception
** (ArgumentError) argument error
    (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true])
    (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
    (stdlib) erl_parse.yrl:1645: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1648: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true])
        (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
        (stdlib) erl_parse.yrl:1645: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1648: :erl_parse.modify_anno1/3
        (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    cover.erl:583: :cover.call/1
    lib/coverex/task.ex:24: Coverex.Task.start/2
    (mix) lib/mix/tasks/test.ex:193: Mix.Tasks.Test.run/1
    (mix) lib/mix/task.ex:296: Mix.Task.run_task/3
    (mix) lib/mix/task.ex:328: Mix.Task.run_alias/3
    (mix) lib/mix/task.ex:261: Mix.Task.run/2
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

09:54:29.257 [error] Process #PID<0.340.0> raised an exception
** (ArgumentError) argument error
    (stdlib) erl_anno.erl:318: :erl_anno.set(:location, -1, [location: -1, generated: true])
    (stdlib) erl_parse.yrl:1516: anonymous fn/3 in :erl_parse.map_anno/2
    (stdlib) erl_parse.yrl:1645: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1637: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1648: :erl_parse.modify_anno1/3
    (stdlib) erl_parse.yrl:1658: :erl_parse.modify_anno1/3

09:54:29.267 [error] Process #PID<0.350.0> raised an exception
** (ArgumentError) argument error
    (stdlib) :ets.insert(:cover_internal_data_table, {{:bump, Myproject.Mymodule, :some_func, 2, 1, 19}, 0})
    cover.erl:1789: :cover.munge_body/4
    cover.erl:1740: :cover.munge_clauses/4
    cover.erl:1719: :cover.munge/4
    cover.erl:1635: :cover.transform_2/5
    cover.erl:1620: :cover.transform/3
    cover.erl:1568: :cover.do_compile_beam2/5
    cover.erl:1478: :cover.do_compile_beam/3

The last paragraph gets printed multiple times for all the different modules that are being tested.

alfert commented 8 years ago

I assume this is a problem with Erlang's cover application (see all the cover.erl lines in the stack traces). My library use cover for the dirty work of generating coverage information and does only the beautifying of the output.

The source code line lib/coverex/task.ex:24: Coverex.Task.start/2 is

:cover.compile_beam_directory(compile_path |> to_char_list)

before that nothing special happens.

Could you please comment out the test_coverage: configuration and run mix test --cover? In that case mix runs directly :cover to generate the coverage output. If this fails, we know that you should send a bug report to the Erlang OTP team. Otherwise I will further dig into your problem.

ephe-meral commented 8 years ago

@alfert Thanks for the hint - you were right, the issue is actually with cover :)

alfert commented 8 years ago

Please upgrade to Elixir 1.3.4, this should solve the issue.

ephe-meral commented 8 years ago

@alfert :+1: Just tested it with 1.3.4, works flawlessly! :)