The API Fortress Jenkins Plugin allows you to run tests during automated builds. The tests that fail may, or may not, cause a build failure based on your settings.
Install the Jenkins plugin
From the Jenkins Update Center, search and install the API Fortress plugin.
Configure a build step
Add the API Fortress build step where it best suits your needs.
There are 4 testing modes available. “Run single test” will run a single test, while the others will run suites of tests.
You can run a single test by providing a test ID. Test IDs can be found in test interstitial pages.
See where to retrieve the test IDs later in this document.
You can run our “automatch” mode by providing a URL representing a certain endpoint. You can configure automatch patterns in the “Automatch” section of each test. Read more about automatch here .
Choosing “by tag” will run multiple tests marked with a certain tag. Tags can be added and edited in the test details.
By running a full project, you will be running all tests contained in the project.
The hook URL is an API endpoint that references a specific project within an API Fortress environment.
See the Hook URLs section to create one.
The following options can apply to any mode.
The plugin can silently run (blocking = false), which lets the build continue with a success and inform you if the test failed using the various methods available. Or it can actively determine the build success (blocking=true), so that the build will wait for the tests result and stop the build if the tests fail.
If checked, no events will be stored within API Fortress. To be used in conjunction with “blocking.”
If checked, no alerts will be sent if the tests fail.
You can override up to 3 parameters in the test scope. These variables will appear within the test scope just like any other variable. Useful if you are looking to override the domain of the service being tested (ie. staging vs production).
Hook URLs are API endpoints representing one of your projects. These endpoints have unique paths, and do not require authentication for most non-disclosing operations.
To create a Hook URL:
- Access your API Fortress dashboard.
- Enter the company configuration screen (gear icon in the top right).
- Choose API Hooks on the side menu.
- Create a new Hook by choosing the user (necessary for advanced functions) and the project.
- A unique URL will be generated. That is the URL to be used in your build step configuration.
Test IDs and Project ID
To retrieve a specific test ID from the API Fortress dashboard: