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

solidity-coverage doesn't work correctly when parallel mode is enabled #4492

Open
fvictorio opened this issue Oct 17, 2023 · 4 comments
Open
Labels
blocked-reason:breaking-change This is a breaking change that can only be done in a major release status:blocked Blocked by other issues or external reasons type:improvement

Comments

@fvictorio
Copy link
Member

This issue is not exactly actionable, because a decent solution is probably a breaking change, but I'm opening it anyway because it's useful input for whenever we tackle the whole test runner thing.

For details, see this comment

@hellwolf
Copy link

any chance to reconsider this?

@hellwolf
Copy link

hellwolf commented Aug 30, 2024

Our test harness is still using hardhat, kudos to the hardhat developers, that now it runs around 6m, using github default runner (https://github.com/superfluid-finance/protocol-monorepo/actions/runs/10631733383/job/29473286607) where we use parallel mode and 4 runners.

In contrast, our coverage test with the exact same set of tests takes more than one hour (https://github.com/superfluid-finance/protocol-monorepo/actions/runs/10631733383/job/29473287853) !

Is there anything we can help to get this resolved?

@cgewecke
Copy link
Contributor

Hi @hellwolf, I help maintain solidity-coverage.

A partial workaround for this problem is to set up CI to run coverage in parallel. The basic idea is to:

  • partition the set of test files passed to the coverage task
  • split coverage into several concurrent jobs, passing test file targets as arguments using the --testfiles command line flag
  • cache the coverage results in shared storage as each job completes
  • combine results in a final step by either:
    • using the instanbul-combine-updated tool
    • passing them as a batch to Codecov CI which automatically merges them on their end

There's a nice example of this being done in CircleCI at Synthetix:

There is a github action (with recipe) for splitting a test suite into equal time groups for parallel execution here:

(If you try this at superfluid and get it working in Github Actions could you open an issue about it at solidity-coverage? I will add it as an example to the documentation there.)

@cgewecke
Copy link
Contributor

Thinking about this again, there might be a path to supporting --parallel from within the solidity-coverage plugin - have left a note about that in solidity-coverage 691#comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-reason:breaking-change This is a breaking change that can only be done in a major release status:blocked Blocked by other issues or external reasons type:improvement
Projects
Status: Backlog
Development

No branches or pull requests

3 participants