Skip to content

Using Azure Test Plans with GitHub deployments

Reading Time: 4 minutes

In this post I want to cover using Azure Test Plans with GitHub deployments. So that I can cover using them together in more detail.

Partly because I mentioned it in my post about using Azure Test Plans for Data Platform deployments. Plus, it gives me a chance to show you that you can use Azure Test Plans to manage deployments done outside of Azure DevOps.

I know a lot of people still prefer to use spreadsheets to manage testing. However, using Azure Test Plans gives you some interesting options and saves spreadsheet sprawl.

By the end of this post, you will have further insight into how to use Azure Test Plans with GitHub deployments.

GitHub Actions deployment example

In this example, I will cover how you can easily setup a test plan in Azure Test Plans for a GitHub Action deployment for SQL Server related databases.

It will be based on the below GitHub Action workflow that I showed in a previous post. Which was about deploying from one source to multiple SQL Server database types using GitHub Actions.

GitHub Actions deployment example for use with Azure Test Plans
GitHub Action workflow

In reality, it can be any type of deployment done in GitHub. For example, a deployment done for a PowerShell module or a Kubernetes cluster.

For this example I created a new test plan in Azure Test Plans. However, you can do this with an existing one.

New test plan

Afterwards, I put in all the steps that I want to do as part of this test plan. In addition, I added a tag of ‘SQL Server’ to the test case. Plus, an image of how the completed workflow looks as an attachment to step 1 as well.

New test case as attachment

In reality, this attachment can be anything. However, an image has the added benefit that a thumbnail of it is displayed when you run the test case. Which I showed in my post about using Azure Test Plans for Data Platform deployments.

Running the test case

Once I have saved the test case it is ready for use the next time a GitHub Action workflow has completed. All I have to do is return to the test case in Azure Test Plans, go to the execute section and select ‘Run for web application’.

Execute the test case

After clicking ‘Run for web application’ the test case appears in a new window.

Test case runner for a GitHub deployment in Azure Test Plans
Running the test case

With the window open I can then go through the test case. Starting with checking that the pipeline in step 1 matches what is in GitHub Actions. Just to recap, I can do this by going into the repository in GitHub and clicking the ‘Actions’ tab.

Checking GitHub Actions as part of a test case in Azure Test Plans
GitHub Actions

After doing that I can work my way through the other steps and check accordingly.

Connecting GitHub to Azure Boards

Whilst the test case application is running you can create a bug in Azure Boards by clicking ‘Create bug’. In reality, you can do this without your GitHub repository being connected to Azure Boards.

Adding GitHub connections for use with Azure Boards
GitHub connections

However, I strongly recommend that you do so. Because doing this will allow you to link the bug in Azure Boards to items in your GitHub repository. Like commits and pull requests. So that you can show work that you have done for that bug.

GitHub commit shown in Azure DevOps bug
GitHub commit shown in Azure DevOps bug

GitHub and Azure Test Plans flow of work

Doing the above with Azure Test Plans and GitHub means that your flow of work can resemble the below method. Showing a very transparent path for all involved. Which is good, because transparency is a promoted value for those who want to work in a DevOps related way.

Flow of work involving both GitHub and Azure Test Plans
Basic flow of work using Azure Test Plans with GitHub

Of course, you can manage your work items using other means. However, you can only use Azure Test Plans if Azure Boards is enabled in your Azure DevOps project. Plus, I can tell you from experience that Azure Boards is a powerful way to manage your work items.

GitHub for Data Platform deployments

On a side note, if you want to learn more about how to use GitHub for Data Platform deployments myself and Sander Stad are presenting for the Southampton and Reading Data Platform and Cloud Group this week. On Wednesday August 4th.

Our session is called ‘GitHub DevOps Duet – Reading and Southampton Edition’ and you can register for it using Meetup. Our session starts around 8PM British Summer Time (9PM Central European Summer Time).

Final words about using Azure Test Plans with GitHub deployments

I hope this post about using Azure Test Plans with GitHub deployments has given some of you ideas.

Of course, if you have any comments or queries about this post feel free to reach out to me.

Published inAzure DevOpsGitHub

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *