๐ ๏ธ Troubleshooting โ Early CLI (early generate-pr)
This guide focuses on issues specific to the Early CLI when running in Jenkins, CircleCI, or other CI/CD environments.
For shared topics like memory crashes, token auth, Jest setup, or commit issues โ see Fundamentals Troubleshooting โ.
โ No Test Files Generatedโ
This can happen for several different reasons, ranging from configuration or permissions issues to already-covered code.
- JavaScript / TypeScript
- Python
Please go through the checklist step by step in ๐ Why No Tests Were Generated
That guide explains every possible cause โ including missing CLI installation, coverage command failures, validation errors, SCM permissions, and more โ along with how to fix each one.
Common causes for Python projects:
- No
.pyfiles changed in the PR โ The agent only generates tests for Python files that were modified in the pull request - No testable functions โ The agent generates tests for top-level functions and class methods. Files with only imports, constants, or type definitions will be skipped
- py-agent not installed โ Make sure
py-agentis installed:pip install py-agent - API key or token issues โ Verify your
API_KEYandTOKENare valid - TEST_FRAMEWORK not set โ Ensure
TEST_FRAMEWORK=pytestis set in your environment
๐ Missing or Invalid API Keyโ
See API Key Missing or Invalid โ
๐ GitHub Token Error or Git Push Failsโ
See Token Insufficient or Git Push Fails โ
๐ฅ Out of Memory Errorโ
Note: This section applies to JavaScript/TypeScript projects only. Python test generation does not require
NODE_OPTIONSmemory tuning.
See Node.js Heap / OOM Fixes โ
๐ py-agent Not Found (Python)โ
If you see an error like py-agent is not installed, install it with:
pip install py-agent
The py-agent package is required in addition to the @earlyai/cli npm package when generating tests for Python projects.
๐ซ No Test Files Generatedโ
See Testable Code Not Found โ
โ ๏ธ Jest Not Installed or Misconfiguredโ
Note: This section applies to JavaScript/TypeScript projects only.
โ ๏ธ Lint / Prettier Hook Breaks Commitโ
Note: This section applies to JavaScript/TypeScript projects only. Lint/format hooks are not yet supported for Python.
If commits fail due to linting or formatting rules in your repo, configure:
export LINT_COMMAND="npx --no eslint $early_filename --fix"
export PRETTIER_COMMAND="npx --no prettier $early_filename --write"
See Lint/Prettier Failures โ
๐งช Coverage Command Failsโ
Note: This section applies to JavaScript/TypeScript projects only. Python projects do not use a separate coverage command.
See Custom Coverage Command Errors โ
โ๏ธ SCM or Git Errors in CIโ
Ensure:
- Git is installed and configured in the agent image
- Token is injected as a credential
- You are using a full clone (not shallow)