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

Throw error when --parallel flag is set #99

Merged
merged 1 commit into from
Feb 11, 2022
Merged

Conversation

cgewecke
Copy link
Owner

@cgewecke cgewecke commented Feb 11, 2022

Initial handling for #98...

(Note: the --parallel flag is not actually supported yet. Pending at hardhat 2359)

@cgewecke cgewecke merged commit 819e461 into master Feb 11, 2022
@cgewecke
Copy link
Owner Author

@fvictorio This is published at an rc tag temporarily (1.0.8-para.0).

yarn add hardhat-gas-reporter@para

(Am going to add a few other things this weekend an publish a patch version sunday or monday.)

@fvictorio
Copy link
Contributor

Hey @cgewecke, thanks for working on this so quickly.

@alcuadrado suggested a better way to approach this: what if, instead of throwing an error, you disable the gas reporter when the --parallel flag is set, and print a warning explaining why? Ideally the warning would be printed at the end, since that's where people will expect to see the coverage.
I think you could do something like this:

subtask(TASK_TEST_RUN_MOCHA_TESTS).setAction(
  async (args: any, hre, runSuper) => {
    if (args.parallel === true) {
      const result = await runSuper()
      // print warning
      return result
    }

@cgewecke
Copy link
Owner Author

@fvictorio Oh, yes that is better. Will update.

@cgewecke cgewecke deleted the detect-parallel branch February 15, 2022 14:07
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.

2 participants