Getting Started#

This is a short step-by-step tutorial to get started with BlueRacer.

Prerequisites#

You need the following to successfully use BlueRacer:

Assumptions#

For simplicity, this tutorial assumes you use pytest on CircleCI. To see specific documentation for your runner & CI of choice, find them on Supported Test Runners and Supported CI services.

GitHub App Installation#

  1. Go to GitHub Marketplace and click the Install button.

    _images/github_install.jpg
  2. Select one or two repositories you’d like to start with and click the Install button again.

    _images/github_install2.jpg

Get BLUERACER_TOKEN#

You will now be redirected to app.blueracer.io where you will get the BLUERACER_TOKEN for your repo. Your CI needs this token to be able to upload test reports to BlueRacer.

  1. Click on your repo.

    _images/blueracer_install.jpg
  2. Save the BLUERACER_TOKEN for later.

    _images/blueracer_install2.jpg

Configure your CI#

Lets assume a basic CircleCI configuration file, .circleci/config.yml, using the pytest test runner:

jobs:
  test:

    steps:
      - checkout
      - run: pytest myapp

To add BlueRacer to this workflow, we need two changes:

  1. Add --junit=junit.xml flag to the pytest command.

  2. Add an additional run step to upload the junit.xml file to BlueRacer.

jobs:
  build_and_test:

    steps:
      - checkout
      - run: pytest --junit=junit.xml myapp
      - run: bash <(curl -s https://app.blueracer.io/upload)

Instructions for other test runners & CIs are available on Supported Test Runners and Supported CI services.

Initial Run#

Before BlueRacer can compare your Pull Requests’ test to existing tests, it needs some data on existing tests. Run your CI for your main branch and verify that BlueRacer successfully processed the uploaded report.

_images/ci_install.jpg

That’s it! BlueRacer is now configured and ready for use!

Open a Pull Request#

From now on, BlueRacer will post a comment on every Pull Request, warning you about potential slow tests.

_images/blueracer_comment.png

Read about different comments and what they mean on GitHub Integration.