Skip to main content

๐ŸŽฏ 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 TypeDefault MAX_TESTABLES
PR Agent5
Commit Agent5
Repository Agent30

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-only for PR and commit agents
  • Increasing this value may increase CI runtime proportionally

โœ… Summaryโ€‹

SettingDefault (PR / Commit)Default (Repo)Purpose
--max-testables530Limit number of methods tested
MAX_TESTABLES530Environment-based equivalent

Use this setting to balance coverage gains against CI execution time, especially in larger repositories or high-churn pull requests.