Evolving Tests
Automatically update tests when your code changes.
Evolving Tests keeps your test suite in sync with your code. When you make changes, Paragon analyzes the PR and proposes test additions, updates, or removals.
How It Works
- You open a PR with code changes
- Paragon analyzes your changes and existing tests
- Paragon posts a GitHub comment with proposed test changes
- Review proposals in the dashboard
- Accept to apply changes, or reject to ignore
Enable Evolving Tests
- Go to Testing > Repos
- Click the repository you want to configure
- Scroll to the Evolving Tests section
- Turn on Enable Evolving Tests
- Configure auto-run, open access, and excluded branches
- Save your settings
Configuration Options
Auto-Run on PR
| Setting | Behavior |
|---|---|
| Enabled | Paragon automatically analyzes every PR |
| Disabled | Manually trigger with @paragon-evolve comment |
When disabled, comment @paragon-evolve on any PR to trigger analysis.
Open Access
Allow external contributors (outside your organization) to trigger @paragon-evolve on their PRs.
Only enable for public repositories where you trust community contributions.
Include Draft PRs
By default, evolving tests only run on non-draft PRs. Enable this to also analyze draft PRs.
Excluded Branches
Skip evolving tests for certain branches. Supports wildcards:
main
develop
release/*
hotfix/*
dependabot/*
Use cases:
- Skip main branch (no PR to a branch you're already on)
- Skip release branches (tests should be stable)
- Skip automated dependency updates
Proposal Types
Paragon proposes three types of changes:
Add New Tests
When you add new code that isn't covered by tests:
### New Tests Proposed
**Add test for `calculateShipping` function**
- Reason: New function added with no test coverage
- Confidence: 95%
- Tests:
- Returns $5 for orders under $25
- Returns $0 for orders over $25 (free shipping)
- Handles international addresses with higher rateUpdate Existing Tests
When code changes affect existing tests:
### Test Updates Proposed
**Update test for `calculateDiscount` function**
- Reason: Function signature changed, added `memberType` parameter
- Confidence: 88%
- Changes:
- Add test cases for "gold" member type (30% discount)
- Add test cases for "silver" member type (20% discount)
- Update existing tests to include memberType parameterRemove Obsolete Tests
When code is removed and tests are no longer needed:
### Tests to Remove
**Remove test for `legacyCalculator` function**
- Reason: Function deleted in this PR
- Confidence: 100%Reviewing Proposals
GitHub Comment
When Paragon analyzes a PR, it posts a comment:
## Evolving Tests Analysis
I analyzed your changes and have **3 proposals**:
| Type | Test | Confidence |
|------|------|------------|
| Add | calculateShipping tests | 95% |
| Update | calculateDiscount tests | 88% |
| Remove | legacyCalculator tests | 100% |
[Review proposals →](https://home.polarity.cc/testing/proposals/abc123)Dashboard Review
Go to Testing > Proposals to see all pending proposals:
- Filter by repository - Focus on one repo
- Filter by type - Added, Updated, Removed
- Preview changes - See proposed code inline
- View analysis - Understand why changes are proposed
Proposal Details
Click any proposal to see:
- Analysis Summary: Why Paragon thinks this change is needed
- Confidence Score: How certain Paragon is (0-100%)
- Proposed Code: The actual test code to be added/updated
- Affected Files: Which test files will change
Accepting Proposals
Accept Single Proposal
- Click the proposal
- Review the changes
- Click "Accept"
- Choose: Push to PR or create new PR
Accept All Proposals
- Go to Testing > Proposals
- Select proposals with checkboxes
- Click "Accept Selected"
What Happens on Accept
When you accept a proposal:
- Paragon generates the test code
- Commits to the PR branch (or creates new PR)
- Posts a GitHub comment confirming changes
- Proposal marked as accepted
## Tests Updated
Applied 3 test changes:
- Added `calculateShipping.test.ts`
- Updated `calculateDiscount.test.ts`
- Removed `legacyCalculator.test.ts`
[View commit →](https://github.com/org/repo/commit/abc123)Rejecting Proposals
Reject Single Proposal
- Click the proposal
- Click "Reject"
- (Optional) Add reason
Rejected proposals won't be proposed again for this PR.
When to Reject
- False positive: Paragon misunderstood the change
- Already covered: Existing tests cover this case
- Not needed: Intentionally not testing this code
- Low confidence: Proposal doesn't look right
Best Practices
Start with Auto-Run Disabled
When first enabling evolving tests:
- Disable auto-run initially
- Manually trigger on a few PRs with
@paragon-evolve - Review proposal quality
- Enable auto-run once satisfied
Review Before Accepting
Always review proposals before accepting:
- Check the generated test code makes sense
- Verify assertions match expected behavior
- Ensure test follows your conventions
Exclude Noisy Branches
Add patterns for branches that don't need test evolution:
dependabot/*
renovate/*
*.md-only
Trust Confidence Scores
| Confidence | Meaning |
|---|---|
| 90%+ | Highly confident, likely accurate |
| 70-90% | Good confidence, review recommended |
| 50-70% | Medium confidence, careful review needed |
| Below 50% | Low confidence, skeptical review |
Troubleshooting
Proposals Not Appearing
- Check evolving tests is enabled in repository settings
- Check auto-run setting - if disabled, use
@paragon-evolve - Check excluded branches - branch might be excluded
- Check draft PR setting - draft PRs off by default
Low Quality Proposals
- Make your PR description detailed
- Include context about what changed and why
- Link to related issues
Too Many Proposals
- Add excluded branches for automated PRs
- Adjust test type filters in settings
- Review and reject false positives (Paragon learns)
Next Steps
Analytics
Track test performance and pass rates