Quick Start ⏱️

Install

Set up the Redefine CLI tool in your CI environment by copy-pasting the code below.

pip install -U redefine --index-url https://pip.redefine.dev/

The Redefine CLI tool supports Python 3.6+ and is currently only available for CI environments, not the local developer's environment.

Configure

Set up the authentication key

Store the Redefine authentication key in your CI system by following the recommended best practices for your specific CI platform: GitHub Actions, GitLab CI, Jenkins, CircleCI, Buildkite, or TeamCity. Once stored, you can export the authentication key to the Redefine CLI by setting the environment variable as REDEFINE_AUTH. This ensures that the CLI can access the authentication key securely and use it for authentication purposes.

If you haven't received your Redefine credentials yet, please reach out to us at help@redefine.dev, We'd be happy to assist you!

Additional Configurations

Check out Configuration Parameters for additional configuration options.

Verify

Once Redefine has been installed and configured, make sure that everything is working properly by running the verify command. This command verifies whether your CI environment is compatible with Redefine, and returns a success message if all is good or an error message detailing any issues that need fixing. To run the command, follow these steps:

redefine verify --pytest

For more information on successful verification output and examples of failure cases, check out Verification Examples.

For a full list of error messages and resolutions, see Verify Troubleshooting.

Run in Discover Mode

With Discover mode, Redefine analyzes your coding patterns and test results to create the initial test optimization model. To start the discovery process, simply replace the verify command from the previous step with the following command:

redefine install --discover --pytest

For more information about selection modes, please see Selection Modes.

Examples

The following examples show the final Redefine for development environments setup using pytest. This gives an idea of what your configuration should look like once everything is in place.

- name: Redefine GitHub Action
    id: run_redefine
    uses: redefinedev/redefine-action@main
    with:
        auth: ${{ secrets.REDEFINE_AUTH_KEY }}
        testing-framework: pytest
        mode: discover
- name: Test with pytest  
    id: pytest 
    run: pytest tests

For all the GitHub Action options see the action's docs.

Tracking the discovery progress

Monitor the progress of the discovery process and verify the data using the Redefine Onboarding Wizard, which offers a user-friendly way to track the process and ensure accurate results.

Last updated