At the end of this post, we will understand how easy it is to achieve a complex architecture like the one shown in the diagram below, with the help of:
- Azure Service Hooks
- TestProject API
- Azure Release Pipelines
Table of Contents
- TestProject API
- Azure DevOps Service
- CI/CD with Azure DevOps and TestProject [Including Detailed Diagram]
- Video Tutorial
The following signups are required before we begin with the actual integration:
In addition, this guide is assuming you have one working test or job created in TestProject, in my case I have already created a job as shown below. To learn more on getting started with TestProject, check out their official maintained documentation or this complete tutorial video series I have created.
Now that we have everything in place – Let’s get started with the actual integration! 👉
TestProject has a rich set of API and they are very sophisticated to do almost everything you can do in TestProject platform, we can also access from TestProject API.
We are going to make use of one of the many awesome APIs of TestProject which helps us trigger executing a Test Job that we have already created, as seen above (EALocalTest). In our case, we will be using the following API endpoint:
In order to execute the API, we need to supply the following from TestProject web portal:
- Project ID
- Job ID
- And of course the API token (which you can create in TestProject from here.
For more information on working with TestProject API, please watch this video: https://www.youtube.com/watch?v=TsQHOuP04js
Now we need to configure TestProject to “talk” with Azure DevOps Service. Since Azure DevOps Service is from Microsoft and it supports many tools out in the market, it also supports generic APIs to trigger as a part of its build and release pipeline. Hence, we are going to leverage the same power of Azure DevOps using what is called as Service Hooks.
In Azure, go to your project settings, from there navigate to Service hooks, and proceed to Create a subscription.
Then, select the Web Hooks service in order to provide event communication via HTTP, and hit next.
Here is where the trigger for the Web Hooks happen from Azure DevOps to TestProject Platform, and the following is most important to specify:
- When to trigger the API?
- Which Release pipeline to trigger?
You need to associate the triggering of Azure Service hooks for any specific release in Azure of Azure release pipeline.
We are going to add the Web Hooks and enter the following details which we grabbed from TestProject in the above section.
Your URL should end up looking something like this:
You do not need to fill in the Basic authentication username and password, however you will need to fill in the HTTP headers field with your API key, and that key must have access to the project you intend to use.
The correct format is:
Once all the details are filled, press Test button to check the handshake of Azure DevOps with TestProject platform and see if the API is triggered. Once successful, you get the message below:
Now, make sure the release pipeline specified in the Web Hook is working properly and gets executed once the build pipeline in Azure DevOps is fully completed, which can be done by enabling CD trigger as shown below:
Now, once any build gets executed while you do code check-in or PR merge, this will call the Release pipeline to execute, which will then call the TestProject API specified in the Web Hooks of Azure DevOps to execute and run the test in the Agent specified in the Job. That said, you can now see the architecture below will come to life 😉