So, I've successfully used Vagrant and Chef to install an MSI onto a Windows guest VM. Woot! Then, I wrote a few tests with ServerSpec that check that after the MSI was installed, files got put into their proper places and things like that.
My question is: What sort of goals should I have when it comes to acceptance testing an install of a package like that? Should I be checking for specific files? But what if there are lots of files? Or is checking for each file too low-level? Too close to the implementation details? What level should I be at when writing acceptance tests for a successful package install?
I use test driven development, so I generally have one test per resource in my recipe. I write the tests first. So if my basic design is:
Then I'd write three tests in my serverspec.
package
to ensure the install happendfile
to ensure the config file is present, with the correct mode, owner, group, and contentservice
that the service is running.Then I'd write my recipe using the package
, file
or template
, and service
resources.