cjk

cjk

Mix test --cover crashes with a FunctionClauseError

Hi,

in a project I am maintaining I am working on increasing test coverage. But when I wanted to check the current state of coverage with mix test --cover, I got this error:

Cover compiling modules ...
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in :cover."-patch_code1/2-lc$^0/1-1-"/1
        cover.erl:2181: :cover."-patch_code1/2-lc$^0/1-1-"(2)
        cover.erl:2181: :cover.patch_code1/2
        cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
        cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
        cover.erl:2191: :cover.patch_code_tuple/5
        cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
        cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
        cover.erl:1649: :cover.transform/4
    cover.erl:602: :cover.call/1
    (mix 1.11.3) lib/mix/tasks/test.coverage.ex:142: anonymous fn/2 in Mix.Tasks.Test.Coverage.cover_compile/1
    (elixir 1.11.3) lib/enum.ex:2193: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.11.3) lib/mix/tasks/test.coverage.ex:141: Mix.Tasks.Test.Coverage.cover_compile/1
    (mix 1.11.3) lib/mix/tasks/test.coverage.ex:122: Mix.Tasks.Test.Coverage.start/2
    (mix 1.11.3) lib/mix/tasks/test.ex:336: Mix.Tasks.Test.do_run/3
    (mix 1.11.3) lib/mix/task.ex:394: Mix.Task.run_task/3
    (mix 1.11.3) lib/mix/task.ex:439: Mix.Task.run_alias/5

08:53:12.591 [error] Process #PID<0.3787.0> raised an exception
** (FunctionClauseError) no function clause matching in :cover."-patch_code1/2-lc$^0/1-1-"/1
    cover.erl:2181: :cover."-patch_code1/2-lc$^0/1-1-"(2)
    cover.erl:2181: :cover.patch_code1/2
    cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
    cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
    cover.erl:2191: :cover.patch_code_tuple/5
    cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
    cover.erl:2183: :cover."-patch_code1/2-lc$^1/1-0-"/2
    cover.erl:1649: :cover.transform/4

Am I doing something wrong?

Best regards,
CK

Marked As Solved

josevalim

josevalim

Creator of Elixir

That’s definitely a bug. Make sure you are on latest Elixir and, if the bug persists, please open up a report!

Last Post!

cjk

cjk

Elixir 1.11.3 on Erlang/OTP 23 (23.2.1)

Will open a bug report, thanks for the feedback!

Where Next?

Popular in Questions Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement