Link Search Menu Expand Document

Integrate with CI

YourBase Test Acceleration uses a dependency graph to accelerate your tests. When you run tests on your local machine, with YourBase Test Acceleration enabled, by default, your dependency graph is stored locally—thus provides only for local acceleration.

But the true power of YourBase Test Acceleration comes in when tests can be accelerated in your CI environment. This requires the dependency graph to be accessible by your CI environment—referred to as Shared Dependency Graph from now on.

The following section guides you to accelerate tests in CI.

Steps to integrate with CI

Step 1: Set up shared dependency graph

YourBase Test Acceleration currently supports storing shared dependency graphs only in AWS S3 buckets. The following sections help you set up your project to use a shared dependency graph in your CI environment.

  1. Set YOURBASE_REMOTE_CACHE in your environment to a valid S3 bucket location.

     # where <bucketname> is an S3 bucket that your machine(s) has Get/Put/List access to.
  2. Set the AWS credentials to be used by YourBase Test Acceleration.

    By default, YourBase Test Acceleration uses the system AWS credentials as specified in the environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

    Alternately, you can specify different credentials to be used exclusively by YourBase Test Acceleration by setting the following environment variables:


    Note: If YourBase Test Acceleration specific environment variables - YOURBASE_AWS_ACCESS_KEY_ID and YOURBASE_AWS_SECRET_ACCESS_KEY are set, YourBase Test Acceleration uses them instead of the system credentials.

Step 2: Install YourBase Test Acceleration in your CI environment

Add YourBase Test Acceleration to your project via requirements.txt or whatever other mechanism you use to install your dependencies in your CI environment.

Step 3: Run tests

Run tests as usual.

That’s it!

The above steps will set up YourBase Test Acceleration to synchronize dependency graphs against the specified storage location when your tests run on your CI environment.

Note: A dependency graph is synchronized with the specified remote storage location:

  • Only when it’s generated from a successful build, and
  • Only if it’s created from a clean working tree, and
  • Only if it’s created from committed code changes. A dependency graph that is created from uncommitted code changes is stored only locally, i.e., it can’t be synchronized against a remote location.