Skip to content

Add splitTestsCompilation solidity setting (8): Mocha updates#8135

Merged
alcuadrado merged 4 commits intodont-split-compilationsfrom
dont-split-compilations-phase-8
Apr 16, 2026
Merged

Add splitTestsCompilation solidity setting (8): Mocha updates#8135
alcuadrado merged 4 commits intodont-split-compilationsfrom
dont-split-compilations-phase-8

Conversation

@alcuadrado
Copy link
Copy Markdown
Member

Just an update to how build is run.

@alcuadrado alcuadrado requested a review from Copilot April 12, 2026 22:13
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 12, 2026

⚠️ No Changeset found

Latest commit: c0f9741

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Hardhat Mocha’s test:mocha task to invoke the build task with a noTests flag that reflects the solidity.splitTestsCompilation setting, and adds regression tests to validate the build invocation behavior.

Changes:

  • Pass noTests: hre.config.solidity.splitTestsCompilation to the build task when running test:mocha.
  • Add tests that override the build task to capture and assert the noTests argument under different configs (splitTestsCompilation true/false, noCompile true).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
packages/hardhat-mocha/src/task-action.ts Adjusts build invocation args based on solidity.splitTestsCompilation.
packages/hardhat-mocha/test/index.ts Adds tests to assert build is called with the expected noTests arg and skipped when noCompile is true.

Comment thread packages/hardhat-mocha/test/index.ts Outdated
Comment thread packages/hardhat-mocha/test/index.ts Outdated
Comment thread packages/hardhat-mocha/test/index.ts Outdated
Comment thread packages/hardhat-mocha/test/index.ts
@alcuadrado
Copy link
Copy Markdown
Member Author

Please ignore the spellcheck failure. The spec file will be deleted before merging.

@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-7 branch from e8842ef to a39546a Compare April 13, 2026 09:35
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-8 branch from 9f86311 to ab9a3ad Compare April 13, 2026 09:35
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-7 branch from a39546a to e61c8a7 Compare April 13, 2026 10:32
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-8 branch from ab9a3ad to 576a4f0 Compare April 13, 2026 10:32
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-7 branch from e61c8a7 to 16d93c5 Compare April 13, 2026 11:07
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-8 branch from 576a4f0 to bac7bca Compare April 13, 2026 11:07
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-7 branch from 16d93c5 to 3b8c159 Compare April 13, 2026 11:21
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-8 branch from bac7bca to 7eec0b3 Compare April 13, 2026 11:21
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-7 branch from 3b8c159 to 69fd895 Compare April 13, 2026 11:39
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-8 branch from 7eec0b3 to e6fee07 Compare April 13, 2026 11:39
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-7 branch from 69fd895 to 5cd78b9 Compare April 13, 2026 12:05
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-8 branch from e6fee07 to 21066f3 Compare April 13, 2026 12:06
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-7 branch from 5cd78b9 to 3997e74 Compare April 13, 2026 12:46
@alcuadrado alcuadrado force-pushed the dont-split-compilations-phase-8 branch 2 times, most recently from d01afb9 to 3b1c1fc Compare April 13, 2026 16:28
@alcuadrado alcuadrado requested a review from Copilot April 13, 2026 16:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Hardhat Mocha plugin’s test:mocha task to invoke the build task with noTests derived from solidity.splitTestsCompilation, and adds regression tests to ensure the correct build arguments are used under different configurations.

Changes:

  • Pass noTests = hre.config.solidity.splitTestsCompilation when running build from the Mocha test task.
  • Add tests that override the build task to capture invocation args and verify noTests behavior.
  • Add a test to ensure compilation is skipped when noCompile: true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
packages/hardhat-mocha/src/task-action.ts Adjusts build invocation to set noTests based on solidity.splitTestsCompilation.
packages/hardhat-mocha/test/index.ts Adds tests that capture and assert build task arguments for different config combinations.

Comment thread packages/hardhat-mocha/test/index.ts Outdated
Comment thread packages/hardhat-mocha/test/index.ts Outdated
Comment thread packages/hardhat-mocha/test/index.ts Outdated
Comment thread packages/hardhat-mocha/test/index.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Hardhat Mocha plugin’s build invocation to respect the new solidity.splitTestsCompilation setting, aligning its behavior with other built-in tasks and adding regression tests to confirm the build task arguments.

Changes:

  • Change Mocha task action to call build with noTests derived from hre.config.solidity.splitTestsCompilation.
  • Add tests that override the build task and assert how noTests is passed depending on splitTestsCompilation.
  • Add a noCompile test to ensure compilation is skipped when requested.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/hardhat-mocha/src/task-action.ts Adjusts build invocation to set noTests based on solidity.splitTestsCompilation.
packages/hardhat-mocha/test/index.ts Adds tests to verify build is invoked with the expected noTests flag (and skipped when noCompile is true).

Comment thread packages/hardhat-mocha/test/index.ts
Comment thread packages/hardhat-mocha/test/index.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Hardhat Mocha plugin’s test mocha task to invoke the build task with a noTests flag that depends on solidity.splitTestsCompilation, aligning build behavior with the new Solidity setting and adding coverage for this behavior.

Changes:

  • Update the Mocha task action to call build with noTests: hre.config.solidity.splitTestsCompilation.
  • Extend the Mocha plugin test suite to assert build is called with the expected noTests value for both splitTestsCompilation states and that noCompile skips compilation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/hardhat-mocha/src/task-action.ts Adjusts build invocation to pass noTests based on solidity.splitTestsCompilation.
packages/hardhat-mocha/test/index.ts Adds tests validating build invocation arguments and noCompile behavior.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Hardhat Mocha plugin behavior to invoke the build task with noTests aligned to the new solidity.splitTestsCompilation setting, and expands test coverage to validate the new build-invocation behavior.

Changes:

  • Adjust testmocha task action to call build with noTests = hre.config.solidity.splitTestsCompilation.
  • Add test cases that assert build is invoked with noTests: false when splitTestsCompilation is disabled, and noTests: true when enabled.
  • Add tests ensuring noCompile: true skips build in both configurations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/hardhat-mocha/test/index.ts Adds build-invocation tests that capture build args and validate noTests / noCompile behaviors.
packages/hardhat-mocha/src/task-action.ts Updates build invocation to set noTests based on solidity.splitTestsCompilation.

Base automatically changed from dont-split-compilations-phase-7 to dont-split-compilations April 16, 2026 16:37
@alcuadrado alcuadrado merged commit 021fe6e into dont-split-compilations Apr 16, 2026
61 checks passed
@alcuadrado alcuadrado deleted the dont-split-compilations-phase-8 branch April 16, 2026 16:37
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.

3 participants