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

Percentage changed without a reason #326

Open
ViseLuca opened this issue May 3, 2024 · 2 comments
Open

Percentage changed without a reason #326

ViseLuca opened this issue May 3, 2024 · 2 comments

Comments

@ViseLuca
Copy link

ViseLuca commented May 3, 2024

Hi,
We have a project that since yesterday in the CI/CD pipeline, and in local env, changed the coverage percentage.

mix coveralls from 89,2% is 88.9%
mix coveralls.html is remaining 89,2% with all the tests

In my local env is changing if I run it 10 times 7 are correct, 3 are not

There is a way to discover why is changing sometimes?

@PaulOstazeski
Copy link

Are you running elixir 17 on erlang 27 by any chance? I've started seeing some unexpected changes to excoveralls output after upgrading erlang and elixir.

@PaulOstazeski
Copy link

So... I'm wrong about the elixir/erlang versions being our culprit. It turns out that we have some hidden dependencies within our test suite such that running mix test --cover twice without changing anything, the code does take different paths and correctly reports different coverage. For example, a test that hits this function will have "flaky" coverage reporting. (ours aren't this, but for the sake of example)

def is_this_covered do
  if :rand.uniform(2) == 1 do
  	covered_half_the_time()
  else
  	covered_the_other_half_of_the_time()
  end
end

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