Notifying Eyes when a build is complete

Synchronizing multiple concurrent builds

By setting the APPLITOOLS_BATCH_ID environment variable, as described in Configuring your CI for the GitHub 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 command to notify Eyes when a build is complete.

  • In the GitHub integration page of the Test Manager, follow the instructions to disable automatic batch closing described in Using Eyes with GitHub. This is a one-time configuration that needs to be done by each team for each repository that has concurrent builds.

  • You need to indicate to Eyes when all of the concurrent builds have completed. You do this by sending the Eyes server an HTTP command. How you do this depends on your environment. For example, on a Linux-based system, you can do it as follows:

    Copy
    eyesserver="eyesapi.applitools.com"  # set this to your Eyes server name.
    githubserver="your_gituhub_server"   # as entered in the Eyes/github integration screen e.g. github.com
    apikey=$APPLITOOLS_API_KEY
    batchid=$APPLITOOLS_BATCH_ID         # this was previously set to the Commit SHA    
    url="https://$eyesserver/api/externals/github/servers/$githubserver/commit/$batchid/complete?apiKey=$apiKey"
    header="Content-Type: application/json --data `{\"serverId\": \"$githubserver", \"commitSha\": \"$batchid\"}`"    
    extraInfo="-H $header  -v -L"

    curl -X POST $url $extraInfo

    Note that various values represented here as "$xxxx" are values set in other parts of the integration:

    • $eyesserver: The URL of your Eyes server - the same value that you set when defining the Eyes server when you run visual Eyes tests (or the default shown in the snippet above).
    • $githubserver: The GitHub server you entered on the Eyes/GitHub integration screen. as described in Configuring your CI for the GitHub integration.
    • $apikey: The same API key you use when running visual Eyes tests.
    • $batchid: The unique value that defines the batch. It is the value assigned to the APPLITOOLS_BATCH_ID environment variable.