Infrastructure Testing with Pester Talk
Go here for the talk: Infrastructure Testing with Pester
After a few technical glitches during the testing phase, things went smoothly during the live presentation. It was a fun experience and I hope people did and will get a lot out of the content.
The attitude I was trying to get across in this talk was to build the foundation first and structure configuration data outside of functional code. Then reuse this code for your tests. Writing Pester tests is the easy part, designing the right tests is the hard part.
Here’s a rundown:
- Infrastructure tests:
- Allow you to trust your code more
- They define “working”
- They provide more reliable code deployments
- Don’t get caught up on the tool you use to implement infrastructure tests. Pester is awesome if you’re familiar with PowerShell but since we’re not testing code like unit tests, you can really use anything.
- Pay attention to test dependencies! Just because you’re testing whether a file exists after your code runs doesn’t mean that the volume that it was supposed to be on is there or even if you have a network connection.
- We built a build pipeline concept with DSC: Source –> Build –> Test
Latest posts by Adam Bertram (see all)
- The Pester Book Challenge - September 4, 2017
- #PSBlogWeek: PowerShell Blogging for an Entire Week - August 23, 2017
- Be Wary of PowerShell’s OutputType Keyword - August 17, 2017