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.
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.
Set YOURBASE_REMOTE_CACHE in your environment to a valid S3 bucket location.
YOURBASE_REMOTE_CACHE=s3://<bucketname>[/key/prefix] # where <bucketname> is an S3 bucket that your machine(s) has Get/Put/List access to.
Set the AWS credentials to be used by YourBase Test Acceleration.
Alternately, you can specify different credentials to be used exclusively by YourBase Test Acceleration by setting the following environment variables:
export YOURBASE_AWS_ACCESS_KEY_ID=<key> export YOURBASE_AWS_SECRET_ACCESS_KEY=<key>
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.
Add YourBase Test Acceleration to your project via
requirements.txt or whatever other mechanism you use to install your dependencies in your CI environment.
Run tests as usual.
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.