pcl and running pcl test for testing.
GitHub Actions Example
- Triggers on pull requests to main/develop branches when assertion or source files change
- Supports manual runs with
workflow_dispatch - Uses the assertions profile via
FOUNDRY_PROFILE: assertions - Installs the latest pcl from GitHub releases
- Runs all assertion tests with
pcl test
Foundry Profile Configuration
Foundry profiles allow you to configure different compilation and testing settings for different parts of your project. For assertions, you typically want separate profiles for unit and fuzz tests so slower suites do not run every time you want quick local feedback. This configuration goes in your project’sfoundry.toml file, which you should be familiar with if you have used Foundry before.
Recommended Profile Structure
Organize your tests into separate folders and create profiles for each test type:Example foundry.toml
Profile Benefits
- Unit tests (
unit-assertions) - Fast feedback during development - Fuzz tests (
fuzz-assertions) - Run separately when testing edge cases - General (
assertions) - Runs all tests for comprehensive validation
pcl test or setting FOUNDRY_PROFILE=<profile>, Foundry uses that profile’s configuration instead of the default one.
Running Tests Locally with Profiles
You can set theFOUNDRY_PROFILE environment variable to use specific profiles:
Best Practices
- Run tests on PR - Catch issues before merging
- Use path filters - Only run tests when relevant files change
- Cache dependencies - Speed up CI runs (Foundry toolchain action handles this)
- Separate profiles - Keep assertion compilation separate from main project
- Pin versions - Consider pinning the
pclversion for reproducibility
- Testing Assertions - Basic testing guide
- Fuzz Testing - Test with random inputs
- Review Backtesting Results - Review the automatic backtest attached to a platform release
- Foundry Book - Testing

