Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cobertura error when protocols and implementations in codebase #307

Closed
gorghoa opened this issue Mar 21, 2023 · 1 comment
Closed

Cobertura error when protocols and implementations in codebase #307

gorghoa opened this issue Mar 21, 2023 · 1 comment

Comments

@gorghoa
Copy link
Contributor

gorghoa commented Mar 21, 2023

A protocol (defprotocol) or implementation (defimpl) definition covered during the tests triggers an error when using the cobertura formatter mix coveralls.cobertura.

** (MatchError) no match of right hand side value: nil
    (excoveralls 0.16.0) lib/excoveralls/cobertura.ex:168: ExCoveralls.Cobertura.module_name/1
    (excoveralls 0.16.0) lib/excoveralls/cobertura.ex:99: anonymous fn/3 in ExCoveralls.Cobertura.generate_packages/2
    (elixir 1.14.2) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (excoveralls 0.16.0) lib/excoveralls/cobertura.ex:97: ExCoveralls.Cobertura.generate_packages/2
    (excoveralls 0.16.0) lib/excoveralls/cobertura.ex:74: ExCoveralls.Cobertura.generate_xml/2
    (excoveralls 0.16.0) lib/excoveralls/cobertura.ex:16: ExCoveralls.Cobertura.execute/2
    (elixir 1.14.2) lib/enum.ex:975: Enum."-each/2-lists^foreach/1-0-"/2
    (excoveralls 0.16.0) lib/excoveralls.ex:65: ExCoveralls.execute/3
    (mix 1.14.2) lib/mix/tasks/test.ex:549: Mix.Tasks.Test.do_run/3
    (mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (excoveralls 0.16.0) lib/mix/tasks.ex:54: Mix.Tasks.Coveralls.do_run/2
    (mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2
    (elixir 1.14.2) lib/code.ex:1260: Code.require_file/2

Made a PR here #306

Thanks!

@parroty
Copy link
Owner

parroty commented Mar 27, 2023

Thank you for the report and fix. I have published the change. I'll be closing the issue, but if there's any missing piece, please reopen it.

@parroty parroty closed this as completed Mar 27, 2023
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

No branches or pull requests

2 participants