Skip to content

Commit

Permalink
Add TS test
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Oct 20, 2022
1 parent e387ba8 commit 701fb7a
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions tests/integration/integration_go_smoke_test.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 701fb7a

Please sign in to comment.