Skip to main content
Add pcl test to your CI workflow to check assertions before merging. This workflow validates assertion logic. Add separate checks for your Ethereum guard wiring, upgrade compatibility, and recovery behavior; passing pcl test does not prove the live submission route. See Testing Strategy.

GitHub Actions Example

The workflow runs pcl test with the assertions profile on matching pull requests or manual dispatch. It installs the latest pcl. Pin a version for reproducible runs.

Foundry Profile Configuration

Use profiles in foundry.toml to separate unit and fuzz tests. Organize your tests into separate folders and create profiles for each test type:

Example foundry.toml

Profile Benefits

Use unit-assertions for unit tests, fuzz-assertions for fuzz tests, and assertions for the full suite.

Running Tests Locally with Profiles

You can set the FOUNDRY_PROFILE environment variable to use specific profiles:
If nothing is specified, the default profile is used.

Best Practices

  1. Run tests on PR - Catch issues before merging
  2. Use path filters - Only run tests when relevant files change
  3. Cache dependencies - Speed up CI runs (Foundry toolchain action handles this)
  4. Separate profiles - Keep assertion compilation separate from main project
  5. Pin versions - Consider pinning the pcl version for reproducibility
Learn More: