diff --git a/tests/integration/integration_go_smoke_test.go b/tests/integration/integration_go_smoke_test.go index 43835a54a666..26e7ea9ff262 100644 --- a/tests/integration/integration_go_smoke_test.go +++ b/tests/integration/integration_go_smoke_test.go @@ -104,12 +104,37 @@ func TestNestedConstructGo(t *testing.T) { testDir := "construct_component" runComponentSetup(t, testDir) - localProviders := - []integration.LocalDependency{ - {Package: "testprovider", Path: buildTestProvider(t, filepath.Join("..", "testprovider"))}, - {Package: "testcomponent", Path: filepath.Join(testDir, "testcomponent-go")}, - {Package: "secondtestcomponent", Path: filepath.Join(testDir, "testcomponent2-go")}} - integration.ProgramTest(t, optsForConstructGo(t, "construct_nested_component", 18, localProviders)) + tests := []struct { + componentDir string + env []string + expectedResourceCount int + }{ + {"testcomponent-go", nil, 18}, + { + componentDir: "testcomponent", + // TODO[pulumi/pulumi#5455]: Dynamic providers fail to load when used from multi-lang components. + // Until we've addressed this, set PULUMI_TEST_YARN_LINK_PULUMI, which tells the integration test + // module to run `yarn install && yarn link @pulumi/pulumi` in the Go program's directory, allowing + // the Node.js dynamic provider plugin to load. + // When the underlying issue has been fixed, the use of this environment variable inside the integration + // test module should be removed. + env: []string{"PULUMI_TEST_YARN_LINK_PULUMI=true"}, + expectedResourceCount: 19, + }, + } + + for _, test := range tests { + test := test + t.Run(test.componentDir, func(t *testing.T) { + localProviders := + []integration.LocalDependency{ + {Package: "testprovider", Path: buildTestProvider(t, filepath.Join("..", "testprovider"))}, + {Package: "testcomponent", Path: filepath.Join(testDir, test.componentDir)}, + {Package: "secondtestcomponent", Path: filepath.Join(testDir, "testcomponent2-go")}} + integration.ProgramTest(t, optsForConstructGo(t, "construct_nested_component", + test.expectedResourceCount, localProviders, test.env...)) + }) + } } func optsForConstructGo(t *testing.T, dir string, expectedResourceCount int, localProviders []integration.LocalDependency, env ...string) *integration.ProgramTestOptions {