
The below test is what I will run to confirm a few things about the resource group, first, that it exists by checking its provisioning state, that it is named how I expect it and lastly that there is only 1.

Pester works on the principal of Describe, Context, It, Should and Mock.

Let’s take a look below at how this works. Take the ResourceGroup test requirement, this would essentially be: Confirm it’s returning Http 200 responses.Confirm my Azure Static WebApp is still there.Typically, the test file and file it tests have the same base file name, such as: New-Log.ps1. tests and distinguish them from other scripts. The distinctive file name extension enables Pester to identify. Confirm my ResourceGroup is still there Pester test files are Windows PowerShell scripts with a.If we take this website for example, to test the Azure infrastructure it’s fairly simple, essentially I’d be looking to: For more information on Pester and what it can do, take a look at the Pester website. Pester is a framework for PowerShell for writing and running tests, it can be used to test pretty much anything from PowerShell scripts, to whole environments to computer and database configuration.

It’s our inability to acknowledge it that’s the trouble.” - Charity Majors - CTO Honeycomb.io - Overview In software development, automated testing plays a huge part of the SDLC so why should it be any different with infrastructure development? In this post, I’ll go through adding automated tests to your newly created environments to add confidence in what you have deployed, is what you wanted to have deployed.
#Pester testing manual
However, there is still quote a lot of manual interaction post deployment of said new infrastructure in that you now need to test your newly spun up environment. One of the best benefits to using Infrastructure as Code is the ability to use pre approved, rapidly deployable templates or “modules” that can be used over and over again with little manual interaction involved in standing up infrastructure.
