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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cobertura now handles defprotocol and defimpl definitions #306

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

gorghoa
Copy link
Contributor

@gorghoa gorghoa commented Mar 21, 2023

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

This PR fixes it.

** (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

ping @albertored for review! 馃檹

@albertored
Copy link
Contributor

Hi @gorghoa ! Thanks for the PR, I've just found the same bug today in one of my projects. Just a small comment on your fix and for me it is ready to be merged (@parroty )

@gorghoa gorghoa force-pushed the fix-cobertura-protocol-impl branch from 9c04ab2 to dd20243 Compare March 21, 2023 23:28
@gorghoa gorghoa force-pushed the fix-cobertura-protocol-impl branch from dd20243 to 689d136 Compare March 21, 2023 23:32
@parroty
Copy link
Owner

parroty commented Mar 26, 2023

Hi. Thank you for the PR and comments.

just a small comment on your fix and for me it is ready to be merged

I just wanted to confirm small comment on your fix part status (it's fixed and ready for merge?). I don't have additional comments, but wanted to confirm before hitting merge button 馃檱 .

@albertored
Copy link
Contributor

@parroty yes, it's ready for merge

@parroty parroty merged commit 8212269 into parroty:master Mar 27, 2023
@parroty
Copy link
Owner

parroty commented Mar 27, 2023

Thanks!

@gorghoa
Copy link
Contributor Author

gorghoa commented Mar 27, 2023

Thank you @albertored and @parroty, have a great day!

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

Successfully merging this pull request may close these issues.

None yet

3 participants