Test coverage includes dependencies?

Hi,
I tried the mix test --cover command and was surprised to see included in the results coverage analysis of the dependencies I use.

image

This doesn’t seem relevant to me, as I’m only interested in the coverage of my code.
Is this expected or am I doing something wrong ?

I have an umbrella app, and I tried to launch the command both on the root of the umbrella or for a specific app, the result is the same.

Thanks for your help !

2 Likes

Mix cover doesn’t support excluding modules or functions. However, ExCoveralls supports excluding files.

I assume that you are talking about all that Jason.Encoder.* modules:

These aren’t dependencies, these are actual modules in your application, just autogenerated as I assume you are using @derive Jason.Encoder in them. The reason for that is that is how the protocols work - under the hood these are behaviours with additional function that is runtime-dispatched.

2 Likes

Thanks for the reply !

Ok that’s much clearer now : I am not directly using @derive in my code, but I am using a dependency which is using @derive Jason.Encoder.

Also thanks @mpope for your advice.

1 Like