🗂️ Navigation
🔧 Infrastructure Integration Testing Framework

Infrastructure Integration Testing Framework

A testing harness that uses the Automation API to spin up ephemeral infrastructure for integration tests and tear it down afterwards.

Visit Website →

Overview

This is not a standalone tool, but a pattern for using the Pulumi Automation API to write integration tests for cloud infrastructure. Within a standard testing framework, the Automation API is used to programmatically deploy a Pulumi stack, creating real cloud resources. The test code then runs assertions against this live infrastructure (e.g., making an HTTP request to a deployed API, querying a database). Finally, in the test teardown phase, the Automation API is called again to destroy all the created resources, ensuring a clean state and avoiding orphaned resources.

✨ Key Features

  • Programmatic stack creation and destruction.
  • Spins up ephemeral infrastructure for tests.
  • Integrates with popular testing frameworks (Pytest, Mocha, unittest, etc.).
  • Access to stack outputs for runtime validation.
  • Enables testing of real cloud resource interactions.

🎯 Key Differentiators

  • Uses the same programming language for both infrastructure definition and testing.
  • Leverages Pulumi's engine for reliable resource creation and cleanup.
  • Avoids shelling out to a CLI, providing a more integrated and debuggable testing experience.

Unique Value: Enables fast, reliable, and repeatable integration testing for cloud infrastructure by managing the complete lifecycle of test resources programmatically.

🎯 Use Cases (4)

Writing integration tests for infrastructure code. Validating that cloud resources are configured and interact correctly. Running tests in a CI/CD pipeline that require live infrastructure. Performing runtime checks against deployed services.

✅ Best For

  • Using Python's `unittest` framework and the Automation API to deploy a stack, verify an AppSync API, test a GraphQL mutation, confirm data is stored in DynamoDB, and then destroy all resources.
  • An example using TypeScript, Mocha, and the Automation API to set up a stack, perform runtime validation, and tear it down as part of a test run.

💡 Check With Vendor

Verify these considerations match your specific requirements:

  • Unit testing, where mocking resources is faster and more appropriate.
  • Simple projects where manual testing is sufficient.

🏆 Alternatives

Terratest Kitchen-Terraform Custom test scripts using cloud SDKs

Unlike Terratest which requires learning Go and wrapping Terraform CLI calls, this approach allows you to use the language your infrastructure is written in. It is more robust than custom scripts as it relies on Pulumi's state management for cleanup, reducing the risk of orphaned resources.

💻 Platforms

API

🔌 Integrations

Pytest Mocha Jest NUnit unittest LocalStack

💰 Pricing

Contact for pricing
Free Tier Available

Free tier: Open source pattern; cost is based on the ephemeral cloud resources used during test runs.

Visit Infrastructure Integration Testing Framework Website →