This is a short step-by-step tutorial to get started with BlueRacer.
You need the following to successfully use BlueRacer:
An account on GitHub where you submit Pull Requests.
A couple of unit tests that you execute with a test runner that can write a junit.xml report.
Run the tests in a CI service.
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#
Go to GitHub Marketplace and click the Install button.
Select one or two repositories you’d like to start with and click the Install button again.
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.
Click on your repo.
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:
--junit=junit.xmlflag to the
Add an additional
runstep to upload the
junit.xmlfile 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.
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.
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.
Read about different comments and what they mean on GitHub Integration.