Hi, wondering if the examples for integration test...
# golang
a
Hi, wondering if the examples for integration testing are still valid https://github.com/pulumi/examples/blob/74db62a03d013c2854d2cf933c074ea0a3bbf69d/testing-integration/README.md I’m trying to do a basic test of deploying a s3 bucket and then my test file (in it’s own test directory)
Copy code
package integration

import (
	"path/filepath"
	"testing"

	"github.com/pulumi/pulumi/pkg/v3/testing/integration"
	"github.com/stretchr/testify/assert"
)

func TestS3Deployment(t *testing.T) {
	wd := filepath.Join("..", "..", "..")

	integration.ProgramTest(t, &integration.ProgramTestOptions{
		Dir:                  wd,
		Quick:                true,
		SkipRefresh:          true,
		ExpectRefreshChanges: true,
		Config: map[string]string{
			"aws:region": "us-east-1",
		},
		Env: map[string]string{
			"AWS_PROFILE": "my-profile",
			"AWS_REGION":  "us-east-1",
		},
		ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) {
			t.Log("Validating S3 bucket creation...")
			var foundBuckets int
			for _, res := range stack.Deployment.Resources {
				if res.Type == "aws:s3/bucket:Bucket" {
					foundBuckets++
				}
			}
			assert.Equal(t, 7, foundBuckets, "Expected exactly one S3 bucket to be created")
		},
	})
}
run go test am I’m getting
Copy code
go test
# github.com/pulumi/pulumi/pkg/v3/resource/deploy/providers
/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.154.0/resource/deploy/providers/registry.go:869:57: undefined: plugin.StreamInvokeRequest
/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.154.0/resource/deploy/providers/registry.go:869:86: undefined: plugin.StreamInvokeResponse
/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.154.0/resource/deploy/providers/registry.go:870:16: undefined: plugin.StreamInvokeResponse
# github.com/pulumi/pulumi/pkg/v3/codegen/schema
/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.154.0/codegen/schema/bind.go:295:70: not enough arguments in call to plugin.NewContext
	have (nil, nil, nil, nil, string, nil, bool, nil)
	want ("context".Context, diag.Sink, diag.Sink, plugin.Host, plugin.ConfigSource, string, map[string]interface{}, bool, "github.com/opentracing/opentracing-go".Span)
/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.154.0/codegen/schema/loader.go:380:66: too many arguments in call to l.host.ResolvePlugin
	have (apitype.PluginKind, string, *semver.Version)
	want ("github.com/pulumi/pulumi/sdk/v3/go/common/workspace".PluginSpec)
/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.154.0/codegen/schema/loader.go:404:66: too many arguments in call to l.host.ResolvePlugin
	have (apitype.PluginKind, string, *semver.Version)
	want ("github.com/pulumi/pulumi/sdk/v3/go/common/workspace".PluginSpec)
# github.com/pulumi/pulumi/pkg/v3/secrets/passphrase
/go/pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.154.0/secrets/passphrase/manager.go:414:12: cannot use &errorCrypter{} (value of type *errorCrypter) as "github.com/pulumi/pulumi/sdk/v3/go/common/resource/config".Crypter value in struct literal: *errorCrypter does not implement "github.com/pulumi/pulumi/sdk/v3/go/common/resource/config".Crypter (missing method BatchEncrypt)
FAIL	github.com/vwinteg/my-infra/pkg/core/s3/test/integration [build failed]
e
Your version of pulumi/sdk and pulumi/pkg must be the same, and we had one bad version go out recently so if your on that they won't link correctly. Latest should work. We've been looking at moving some of this stuff to just live in sdk to prevent issues like this.
a
So you mean I should use
"<http://github.com/pulumi/pulumi/pkg/testing/integration|github.com/pulumi/pulumi/pkg/testing/integration>"
instead of
"<http://github.com/pulumi/pulumi/pkg/v3/testing/integration|github.com/pulumi/pulumi/pkg/v3/testing/integration>"
?
e
no pulumi/pkg/v3 but it must be the same version as pulumi/sdk/v3 in your go.mod
a
I only have one pulumi/sdk/v3 in my go.mod
Copy code
<http://github.com/pulumi/pulumi/sdk/v3|github.com/pulumi/pulumi/sdk/v3> v3.185.0
e
well your importing pkg/v3
Copy code
import (
	"path/filepath"
	"testing"

	"<http://github.com/pulumi/pulumi/pkg/v3/testing/integration|github.com/pulumi/pulumi/pkg/v3/testing/integration>"
so that should be in your go.mod as well
a
Sorry, yes
Copy code
<http://github.com/pulumi/pulumi/pkg/v3|github.com/pulumi/pulumi/pkg/v3> v3.154.0
	<http://github.com/pulumi/pulumi/sdk/v3|github.com/pulumi/pulumi/sdk/v3> v3.185.0
e
set them both the 3.185, it should work
a
That got me past the compiling error, now need to work through the actual execution errors, Thanks!