https://pulumi.com logo
#python
Title
# python
w

white-airport-48392

04/22/2020, 5:21 AM
Can someone point me to an integration testing example other than in go ? , Pulumi 2.0 supports multi language integration testing as per documentation ?
l

lemon-agent-27707

04/22/2020, 6:02 AM
The integration testing framework is implemented in go, but supports running stacks authored in any language. See this example that tests a typescript program https://github.com/pulumi/examples/tree/master/testing-integration
w

white-airport-48392

04/22/2020, 6:36 AM
Ok , so the integration test itself should be written in go ?
@lemon-agent-27707 So I am getting error: --yes must be passed in to proceed when running in non-interactive mode
When running an integration test
Does this have anything to do with upgrading to 2.0 ?
l

lemon-agent-27707

04/22/2020, 9:48 AM
w

white-airport-48392

04/23/2020, 2:50 AM
Copy code
func TestExamples(t *testing.T) {
	awsRegion := os.Getenv("AWS_REGION")
	if awsRegion == "" {
		awsRegion = "us-west-2"
	}

	cwd, _ := os.Getwd()
	integration.ProgramTest(t, &integration.ProgramTestOptions{
		Quick:       true,
		SkipRefresh: true,
		Dir:         path.Join(cwd, "..", "..", "network"),
		Config: map[string]string{
			"aws:region": awsRegion,
		},
		UpdateCommandlineFlags: []string{"--non-interactive", "--yes"},
		StackName:              "dev",
	})

	
}
I had to do this to get it to work
UpdateCommandlineFlags: []string{"--non-interactive", "--yes"}
This is my go.mod
Copy code
module pulumi/integration_tests

go 1.14


require (
	<http://github.com/Azure/go-autorest|github.com/Azure/go-autorest> v12.2.0+incompatible
	<http://github.com/pulumi/pulumi|github.com/pulumi/pulumi> v1.12.0
    
)
l

lemon-agent-27707

04/24/2020, 5:47 PM
That version is about ~2 months old. Have you tried v2?
<http://github.com/pulumi/pulumi/pkg/v2|github.com/pulumi/pulumi/pkg/v2> v2.0.0