Skip to content

Document Solidity test profiles - #297

Merged
kanej merged 9 commits into
mainfrom
solidity-test-profiles
Sep 24, 2026
Merged

kanej merged 9 commits into
mainfrom
solidity-test-profiles

Conversation

@schaable

@schaable schaable commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Documents Solidity test profiles, which let you run your tests with different settings and select them with --test-profile.

  • Adds a Test Profiles guide under Testing, covering configuration, the lack of inheritance between profiles, and how they relate to Build Profiles
  • Documents test.solidity.profiles in the configuration reference
  • Documents profile-scoped inline directives, and fixes the Foundry compatibility section, which said that omitting the profile was equivalent to using default
  • Adds two migration steps to the Foundry guide: splitting a foundry.toml profile across the build and test axes, and dropping the default. prefix from forge-config: annotations
  • Links to the new guide from the testing overview, the Solidity tests guide, the Build Profiles guide, and the Foundry compatibility reference

Also fixes an unrelated error in the allowInternalExpectRevert example, which used this.myInternalHelper(). That's an external call at a lower depth, so expectRevert catches it with or without the setting; only a direct internal call demonstrates it.

Related hardhat PR: NomicFoundation/hardhat#8145
Related EDR PR: github.com/NomicFoundation/edr/pull/1715

@schaable
schaable requested a lite review from Copilot September 2, 2026 17:32
@schaable schaable self-assigned this Sep 2, 2026
@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hardhat-website Ready Ready Preview Sep 24, 2026 12:26pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are documentation-focused and coherent, with only a minor capitalization consistency nit identified.

Pull request overview

Adds end-to-end documentation for Solidity Test Profiles in Hardhat 3, including configuration shapes, profile selection, Foundry migration guidance, and cross-linking from existing testing/build-profile docs.

Changes:

  • Introduces a new Testing guide for Test Profiles and links it across relevant guides and references.
  • Updates the configuration reference to document test.solidity.profiles and the non-inheritance model.
  • Extends inline configuration docs with profile-scoped directives and updates Foundry compatibility/migration guidance accordingly.
File summaries
File Description
STYLE.md Adds “Test Profile” to the proper-noun capitalization list.
src/content/docs/docs/reference/foundry-compatibility.mdx Adds links/explanation connecting Foundry profiles/annotations to Hardhat Test Profiles and inline configuration.
src/content/docs/docs/reference/configuration.mdx Documents test.solidity.profiles, mutual exclusivity rules, naming constraints, and non-inheritance.
src/content/docs/docs/migrate-from-foundry/index.mdx Adds migration steps for splitting Foundry profiles across build/test axes and converting forge-config: annotations.
src/content/docs/docs/guides/writing-contracts/build-profiles.mdx Clarifies Build Profiles scope and links to Test Profiles.
src/content/docs/docs/guides/testing/using-solidity.mdx Adds guidance for selecting a Test Profile via --test-profile and links to the new guide.
src/content/docs/docs/guides/testing/test-profiles.mdx New guide explaining configuration, selection, non-inheritance, and relation to Build Profiles/inline config.
src/content/docs/docs/guides/testing/inline-configuration.mdx Documents profile-scoped inline overrides and corrects Foundry compatibility semantics; fixes allowInternalExpectRevert example.
src/content/docs/docs/guides/testing/index.mdx Adds link to the Test Profiles guide from the Testing overview.
src/content/docs/docs/guides/testing/gas-statistics.mdx Adjusts sidebar order to accommodate the new guide.
src/content/docs/docs/guides/testing/gas-snapshots.mdx Adjusts sidebar order to accommodate the new guide.
src/content/docs/docs/guides/testing/eip712-types.mdx Adjusts sidebar order to accommodate the new guide.
src/content/docs/docs/guides/testing/code-coverage.mdx Adjusts sidebar order to accommodate the new guide.
Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/content/docs/docs/guides/testing/test-profiles.mdx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread src/content/docs/docs/guides/testing/test-profiles.mdx
Comment thread src/content/docs/docs/guides/testing/test-profiles.mdx Outdated
Comment thread src/content/docs/docs/guides/testing/test-profiles.mdx Outdated
Comment thread src/content/docs/docs/guides/testing/using-solidity.mdx Outdated
Comment thread src/content/docs/docs/guides/testing/inline-configuration.mdx Outdated
Comment thread src/content/docs/docs/migrate-from-foundry/index.mdx Outdated
Comment thread src/content/docs/docs/migrate-from-foundry/index.mdx Outdated
Comment thread src/content/docs/docs/migrate-from-foundry/index.mdx Outdated
Comment thread src/content/docs/docs/reference/configuration.mdx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Clarify that default.<key> annotations must drop the default. prefix for overrides intended for every Test Profile.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Comment thread src/content/docs/docs/migrate-from-foundry/index.mdx Outdated
Comment thread src/content/docs/docs/guides/testing/inline-configuration.mdx Outdated
Comment thread src/content/docs/docs/guides/testing/inline-configuration.mdx Outdated
Comment thread src/content/docs/docs/guides/testing/inline-configuration.mdx Outdated
Comment thread src/content/docs/docs/guides/testing/test-profiles.mdx Outdated
@kanej
kanej added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit c1c90cb Sep 24, 2026
3 checks passed
@kanej
kanej deleted the solidity-test-profiles branch September 24, 2026 17:43

This branch was successfully deployed

1 active deployment
Preview — 6ba1b917 Deployed Sep 24, 2026 by vercel[bot]
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