testing-unit-go-components

command module
v0.0.0-...-b2a63a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

Deploy this example with Pulumi Deploy this example with Pulumi

Unit Testing Pulumi Programs with Components in Go

An example of writing mock-based unit tests written in Go, involving Pulumi Components such as Helm Chart v4.

The program code to be tested (main.go:NewNginxComponent) consists of a code block that creates a Helm Chart resource, locates the Service resource that is created by the chart, and then extracts the assigned ingress IP for later use. The test program uses mocking to simulate the behavior of the Helm Chart resource.

Prerequisites

Install Go.

Running the tests

  1. Run the tests:

    $ go test
    
    PASS
    ok  	testing-unit-go-components	0.400s
    

Further steps

Learn more about testing Pulumi programs:

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL