Use Smarter Testing to get faster feedback on local test runs Preview

Language Icon 9 days ago · 3 min read
Cloud
Contribute Go to Code
Smarter Testing is available in preview. This means the product is in early stages and you may encounter bugs, unexpected behavior, or incomplete features. When the feature is made generally available, there will be a cost associated with access and usage.

Use Smarter Testing locally during development (test impact analysis and auto-rerun failed tests) to speed up your test runs.

Prerequisites

Before using Smarter Testing locally, ensure you have:

Using Test Impact Analysis locally

Get and set your CircleCI API token

  1. Navigate to User Settings > Personal API Tokens.

  2. Create a new token or use an existing one.

  3. Copy the token value.

Set via CLI configuration

$ circleci setup

Follow the prompts to configure your token. Learn more in the Configure the CLI Guide.

Select and run tests using impact data stored in CircleCI

$ circleci run testsuite "ci tests"

If we are unable to autodetect your project, which could happen if you have a circleci type organization (more information on organization types in the Users, Organizations, and Integrations Guide), the --project-id flag can be set.

$ circleci run testsuite "ci tests" --project-id=<your-project-id>

Or if you have not configured your token via circleci setup:

$ circleci run testsuite "ci tests" \
    --project-id=<your-project-id> \
    --circleci-token=<your-token>
Analysis is always disabled when running locally without the --local flag, regardless of the --test-analysis flag value.

Use auto-rerun failed tests locally

Auto-rerun failed tests works automatically when running your test suite locally. Failed tests will be retried up to the configured max-auto-rerun value set in your .circleci/test-suites.yml.

$ circleci run testsuite "ci tests" --local