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

Latest version of mimic breaks test coverage generation #53

Open
nulian opened this issue Jan 13, 2023 · 7 comments
Open

Latest version of mimic breaks test coverage generation #53

nulian opened this issue Jan 13, 2023 · 7 comments

Comments

@nulian
Copy link

nulian commented Jan 13, 2023

When I update mimic to the latest version in a project I work on it breaks test coverage.

12:43:43.169 [error] Task #PID<0.13868.0> started from Mimic.Server terminating
** (MatchError) no match of right hand side value: {:error, {:not_cover_compiled, Synapse.AppRequest.Application.Mimic.Original.Module}}
    (mimic 1.7.4) lib/mimic/cover.ex:52: Mimic.Cover.export_coverdata!/1
    (mimic 1.7.4) lib/mimic/cover.ex:32: Mimic.Cover.clear_module_and_import_coverdata!/3
    (elixir 1.14.2) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2
    (elixir 1.14.2) lib/task/supervised.ex:34: Task.Supervised.reply/4
    (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Function: #Function<9.132716098/0 in Mimic.Server.handle_call/3>
@dylan-chong
Copy link
Contributor

Yikes this would have been me. Can you provide some replication steps?

@nulian
Copy link
Author

nulian commented Feb 3, 2023

It's in a pretty big project so don't have a good simple example case not sure how it get's triggered.
Think it might be because the project still uses for some older mocks from the old elixir mock library and maybe that conflicts.

@edgurgel
Copy link
Owner

Think it might be because the project still uses for some older mocks from the old elixir mock library and maybe that conflicts.

That's very much possible! We didn't architect Mimic to work with other libraries that also touch on the cover data 🤔

@ricksonoliveira
Copy link

Any updates on this? getting this same on a project

@ricksonoliveira
Copy link

@edgurgel @dylan-chong

@edgurgel
Copy link
Owner

Hi team if we have a simple way to replicate the issue we can investigate

@ricksonoliveira
Copy link

To replicate this you just need to have another mock lib along with Mimic, in my case I have the mock lib and the coveralls lib, and have at least one test using the Mock and other using Mimic, then try to run mix coveralls

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

4 participants