CircleCI Integration¶
In this guide we'll show you how to set up a CircleCI Pipeline so Mayhem can automatically test your API on every push.
You will need the following to run Mayhem in your CircleCI pipeline:
- Create a Mayhem API token.
- Add the newly created token as an Environment Variable in the pipeline's context named
MAPI_TOKEN
Pipeline Configuration for Mayhem with CircleCI¶
Testing your API is easy. First add the CircleCI Orb to your .circleci/config.yml
file.
1 2 3 |
|
Pipeline Hosted Service¶
Create a new job to scan your API and start your service. Then call the mapi/scan
command to run Mayhem against your service and store any artifacts or test results at your desired location.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Then add the new job to your workflow.
1 2 3 4 |
|
Deployed Service¶
To test a service that is already deployed and not running as part of the build pipeline, use the mapi/scan
job in your workflow. Mayhem should never be executed against production environments.
1 2 3 4 5 6 |
|