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)
- Building HTML Reports In Powershell With Convertto-Html - May 25, 2017
- File Cannot Be Accessed Fix With Handle.exe - May 24, 2017
- Powershell Streams: Write-Host, Write-Output, Write-Verbose, Write-Error - May 23, 2017