Unit Testing Pulumi programs in Go
An example that applies unit testing to Go and AWS resources.
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set testing-unit-gocd pulumi-examples/testing-unit-goAn example of writing mock-based unit tests with both infrastructure definition and tests written in Go.
Prerequisites#
Running the tests#
-
Run the tests:
$ go testPASSok testing-unit-go 0.400s
Further steps#
Learn more about testing Pulumi programs: