Skip to main content

Search the Dev Center

Search tutorials, templates, examples, and more.

Integration testing of Pulumi programs in Go

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set testing-integration
cd pulumi-examples/testing-integration

This integration test treats infrastructure deployed by a Pulumi program as a “black box”. It deploys the infrastructure, retrieves an endpoint from stack outputs, sends an HTTP request to the endpoint, validates the response, and tears down the infrastructure again.

This test deploys a static website as an AWS S3 bucket and checks that the site is reachable.

Prerequisites#

  1. Install Pulumi
  2. Configure AWS credentials
  3. Install Go

Running the tests#

Run the tests:

Terminal window
go test

You should see output similar to the following:

PASS
ok github.com/pulumi/examples/testing-integration 65.749s

Learn more#

Learn more about testing Pulumi programs:

Related

The infrastructure as code platform for any cloud.