How do you folks test your SST/CDK changes? - I h...
# sst
d
How do you folks test your SST/CDK changes? • I have a bad habit of deploying any new changes to our QA environment, and pissing off everyone using that environment. •
jest test
work for you?
f
Haha do u have ur own AWS account? I usually test in the
frank
stage that's deployed to my playground AWS account.
b
I tend to write unit tests in jest for the stack output for anything controversial, unit tests are run as part of our CI prior to deployment. Otherwise we’re just deploying stuff straight in to our staging env. and letting people know that something may be broken for 10 minutes 😂
s
My primary concern is to not change/destroy "sensitive" stacks. Do you utilise the tests in this manner? I am also trying to look at some sort of workflow that requires a manual approval step against CDK diffs, but going for a poor mans version of this by including the diff output in each PR.
b
It’s not the purpose behind them but it doesn’t serve to protect the resources that are being tested. For some stuff with one of our Step Functions I wrote a bunch of tests to ensure they have a base set of permissions, that certain lambdas have specific names, etc… It means that if someone changes any of the tested details the tests will fail and the deployment won’t process. It requires the person making the changes to think about the change and either change the test or change the stack to fit the test constraints.