CircleCI#

Lets assume a basic CircleCI configuration file, .circleci/config.yml:

jobs:
  build_and_test:

    steps:
      - checkout
      - run:
          name: Run tests
          command: python -m pytest

To add BlueRacer support, add another run step, so the configuration file looks like so:

jobs:
  build_and_test:

    steps:
      - checkout
      - run:
          name: Run tests
          command: python -m pytest
      - run:
          name: Upload test report to BlueRacer.io
          command: |
            bash <(curl -s https://app.blueracer.io/upload)

That’s it, you’re done!

Missing Pull Request ID#

By default, CircleCI automatically runs your workflows for every commit in every branch. As such, a run for a Pull Request will start before your Pull Request is even created. How so?

The process to create a Pull Request consists of these steps:

  1. Create a new commit in a local branch.

  2. Push the local branch to a new branch on GitHub.

  3. Create a Pull Request from this new branch to your main branch.

CircleCI will start running already at step 2.! At this stage, the Pull Request does not yet exist! So when the test report is uploaded to BlueRacer, it doesn’t know the Pull Request ID and hence BlueRacer does not know which Pull Request to post a comment to.

There are three possible solutions to this problem:

1. Re-run the job#

Use the CircleCI Web UI to re-run the job after Pull Request has been created.

../_images/circleci_retry.png

2. Push more commits#

Push a new commit to the new branch. CircleCI will run again, but this time the Pull Request ID is known, and can be sent to BlueRacer.

../_images/github_multiple_commits.png