Hi, interested to see how people are doing CD with...
# general
m
Hi, interested to see how people are doing CD with Pulumi and if there’s a recommended way for smoke tests during/post-up? One route I was considering was building in checks to custom resources, or failing that relying on stack outputs passed through to something else that can run the required validations. Would love to see what people are doing in this space
l
That might work for unit tests, but for post-up smoke tests, wouldn't you need tests against the deployed resources? That's beyond Pulumi's sphere of influence. Pulumi supports integration testing (https://www.pulumi.com/docs/iac/concepts/testing/integration/) and there's a small section in there called "Runtime testing", but I'd consider doing something completely separate from Pulumi for this. Checking if your DNS and load balancer are configured correctly to get a HTTP request to your web server and back can be tested a thousand ways, and they'll all work even if you're not using Pulumi.
m
Yeah the runtime testing mentioned is closest to what I had in mind. Imo the benefit to keeping it within a Pulumi program would be having access to the state/resource properties at run time, rather than shipping a load of config out to another tool, whilst ensuring that fast feedback is available after every
up
. But like you say there are plenty of tools to do that outside of Pulumi, so if there are any examples people are doing that would be keen to see
l
I used to use serverspec and inspec, they were good once upon a time. These days I limit myself to "functional" testing: I deliberately don't test the mechanics, just whatever the mechanics have been put in place for. I don't care about (e.g.) the routing tables: so long as the internet can reach my webserver and cannot reach my database, that's all the testing I need.