๐ฏ Max Testables
Early agents generate tests for eligible methods based on visibility, coverage, and change detection.
The max-testables setting allows you to cap the number of methods that will be processed in a single run.
This provides a practical way to control execution time and resource usage in CI workflows.
๐ง What This Controlsโ
After all other filtering logic is applied (visibility, coverage, and change detection), Early applies a final limit on how many methods will be selected for test generation.
This limit:
- Does not change which methods are eligible
- Only limits how many eligible methods are processed
- Helps keep CI runs predictable and bounded
๐ Default Valuesโ
The default limit depends on the agent type:
| Agent Type | Default MAX_TESTABLES |
|---|---|
| PR Agent | 5 |
| Commit Agent | 5 |
| Repository Agent | 30 |
These defaults are tuned to balance coverage improvement with reasonable CI execution time.
โ๏ธ Configuration Optionsโ
You can configure this limit using either a CLI flag or an environment variable.
CLI Flagโ
--max-testables <number>
Environment Variableโ
export MAX_TESTABLES=<number>
Both options are equivalent.
๐งช Behavior Detailsโ
- The limit is applied after all filtering logic completes
- If fewer eligible methods are found than the limit, all are processed
- If more are found, only the first N methods are selected
- Selection order is deterministic within a run
This ensures stable and predictable behavior across executions.
๐ง When to Tune This Valueโ
You may want to lower the limit when:
- CI time is critical
- PRs tend to touch many methods
- You want fast, incremental feedback
You may want to increase the limit when:
- Running repository-wide or scheduled jobs
- Performing coverage backfills
- You want more aggressive test generation in a single run
๐งช Example: GitHub Actionsโ
env:
MAX_TESTABLES: "3"
This limits test generation to at most 3 methods for the run.
๐งช Example: Jenkinsโ
environment {
MAX_TESTABLES = '10'
}
Or inline before running the CLI:
export MAX_TESTABLES=10
early generate-pr
๐ Notesโ
- This setting applies to all agent types, including PR, commit, and repository agents
- It works in combination with
changed-methods-onlyfor PR and commit agents - Increasing this value may increase CI runtime proportionally
โ Summaryโ
| Setting | Default (PR / Commit) | Default (Repo) | Purpose |
|---|---|---|---|
--max-testables | 5 | 30 | Limit number of methods tested |
MAX_TESTABLES | 5 | 30 | Environment-based equivalent |
Use this setting to balance coverage gains against CI execution time, especially in larger repositories or high-churn pull requests.