Notifying Eyes when a build is complete
By setting the APPLITOOLS_BATCH_ID environment variable, (as described in Configuring your CI for Bitbucket integration), Eyes puts the results of all tests in a particular CI build in the same Test Manager batch. In some setups, you need to disable this automatic notification and add a cURL command to notify Eyes when a build is complete. Below are the most common setups when this command is needed:
-
In your CI system, Bitbucket cannot recognize an End of Build event, in which case add the cURL command to the end of the build script to notify Eyes that the build is complete.
-
If you have multiple concurrent builds, or parallel push and pull requests, add the cURL command to the end of main script build to prevent Eyes from receiving End of Build notifications before all builds have completed.
Setting an End of Build notification to Eyes
-
If you have multiple concurrent builds, on the Bitbucket integration page of the Test Manager, disable automatic batch closing. This is a one-time configuration that needs to be done by each team for each repository that has concurrent builds.
-
On the Admin panel, click the Teams tile.
-
Click on the name of the team you want to configure.
-
On the Integrations tab, click BITBUCKET and select the Bitbucket repository.
-
Click Show batch closing control and disable Automated batch closing.
-
-
Add an cURL command at the end of the build script to tell Eyes that the build is complete. The following is an example of the required script in a Linux-based system:
Copycurl -X POST "$APPLITOOLS_SERVER_URL/api/externals/bitbucket/servers/<bitbucket server host>/commit/$APPLITOOLS_BATCH_ID/$APPLITOOLS_BATCH_BUILD_ID/complete?apiKey=$APPLITOOLS_API_KEY"
Where:
-
$APPLITOOLS_SERVER_URL
– The URL of the Eyes server as configured in Configuring your CI for Bitbucket integration. -
<bitbucket server host>
– The URL of the Eyes server. If you use the public Bitbucket server, the URL isbitbucket.org
. -
$APPLITOOLS_BATCH_ID
– The Commit SHA of the current build as configured in Configuring your CI for Bitbucket integration. -
APPLITOOLS_BATCH_BUILD_ID
(optional) – The Bitbucket build ID -
$APPLITOOLS_API_KEY"
– Your API key. To obtain your key see How to obtain your API key.
-