The API Fortress Jenkins Plugin allows you to run tests during automated builds. The tests that fail can cause a build failure based on your Jenkins settings.
Watch the walkthrough video.
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. This feature is 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 corner).
- Choose API Hooks in the sidebar.
- 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:
- Access the tests list for the project you intend to use.
- Edit one of tests and access the interstitial page.
- Click on “show/hide test information.”
- The test ID and the Project ID are shown here.