logo logo

Continues Integration and Delivery with Azure DevOps and TestProject

Azure DevOps and TestProject

In this post, we will discuss how we can leverage the power of TestProject’s API to integrate with Azure DevOps Service and run automated tests in the TestProject platform as part of your CI/CD flow.

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

  1. Pre-requisites
  2. TestProject API
  3. Azure DevOps Service
  4. CI/CD with Azure DevOps and TestProject [Including Detailed Diagram]
  5. Video Tutorial

Pre-requisite

The following signups are required before we begin with the actual integration:

  1. TestProject signup (100% free)
  2. Azure DevOps service signup (free to signup)

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.

TestProject Job

Now that we have everything in place – Let’s get started with the actual integration! 👉

TestProjects API

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:

Trigger Job with TestProject API

In order to execute the API, we need to supply the following from TestProject web portal:

  • Project ID
    TestProject 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

Azure DevOps Service

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.

Azure DevOps Web Hooks

 

Setting Trigger

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.

Triggering Azure DevOps Web Hooks

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:
https://api.testproject.io/v2/projects/UKwphfwhHkaBQgYuarfUng/jobs/IRQofWcTyEStSR0AZJkeyA/run

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:
Authorization: {API_KEY}

Azure DevOps Web Hooks Job Trigger

 

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:

Azure DevOps with TestProject platform Handshake message

Azure Release Pipeline Integration

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:

Azure Release Pipeline Integration

CI/CD with Azure DevOps and TestProject

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 😉

Azure DevOps and TestProject

 

This entire tutorial is also available in a video tutorial format for you to enjoy:

 

About the author

Karthik KK

I am Karthik K.K. I do consulting, blogging, and researching on various tools and technologies which inspire my interest. I have been into Software Automation Testing for over 14 years now and my interest in learning new stuff which enables automation has never been compromised.

Due to my passion in automation testing I got fully exposed to tools and languages like

Desktop & Web : QTP, Selenium, Specflow, VS Coded UI, Ranorex ,Test Complete and Cucumber
Mobile : Appium, Robotium,Calabash, Espresso, Selendroid
Languages : C#, Java, Ruby, Powershell, Javascript, VBScript
Cloud Tools : Azure, Dockers
Misc Tools: Mockito, Rest-assured, Bound-Box,FluentAutomation
Interested in: MVC, Entity framework, LINQ, Fakes, Distributed deployment, SAAS

Follow on YouTube – https://youtube.com/executeautomation
Follow on Twitter – https://twitter.com/executeauto
Follow on linkedIn – https://www.linkedin.com/company/executeautomation/
Follow on Facebook – https://www.facebook.com/executeautomation/

 

Leave a Reply

FacebookLinkedInTwitterEmail