Skip to content

Commit aad942b

Browse files
authored
tests: add SkipInstall option for pulumitest tests (#3049)
### Proposed changes This PR explicitly sets the `opttest.SkipInstall()` option for our yaml tests. It is observed that the test framework/automation API is unable successfully run `pulumi install` prior to the other pulumi operations. This error was hit in the presubmit for #3046, but went unnoticed in the past due to the `TestTerraformConvert` installing the right plugins before the other tests hit the installation step. Manual validation: - Deleted the local `~/.pulumi/plugin` folder - Run the tests without the changes and notice the test errors - Run the tests with the changes here and they pass ### Related issues (optional) Fixes: #3048
1 parent 1100978 commit aad942b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/sdk/java/chartv4_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import (
44
"testing"
55

66
"github.com/pulumi/providertest/pulumitest"
7+
"github.com/pulumi/providertest/pulumitest/opttest"
78
"github.com/pulumi/pulumi/sdk/v3/go/auto/optup"
89
)
910

1011
// TestChartV4 deploys a complex stack using chart/v4 package.
1112
func TestChartv4(t *testing.T) {
12-
test := pulumitest.NewPulumiTest(t, "testdata/chartv4")
13+
test := pulumitest.NewPulumiTest(t, "testdata/chartv4", opttest.SkipInstall())
1314
t.Logf("into %s", test.Source())
1415
t.Cleanup(func() {
1516
test.Destroy()

tests/sdk/java/kustomizev2_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestKustomizeV2(t *testing.T) {
2020
pluginHome, _ := filepath.Abs("testdata/kustomizev2/pluginExample/plugin")
2121
test := pulumitest.NewPulumiTest(t, "testdata/kustomizev2",
2222
opttest.Env("KUSTOMIZE_PLUGIN_HOME", pluginHome),
23+
opttest.SkipInstall(),
2324
)
2425
t.Logf("into %s", test.Source())
2526
t.Cleanup(func() {

tests/sdk/java/yamlv2_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"testing"
55

66
"github.com/pulumi/providertest/pulumitest"
7+
"github.com/pulumi/providertest/pulumitest/opttest"
78
"github.com/stretchr/testify/assert"
89
)
910

@@ -14,7 +15,7 @@ import (
1415
// - installs and uses CRDs across components
1516
// - uses implicit and explicit dependencies
1617
func TestYamlV2(t *testing.T) {
17-
test := pulumitest.NewPulumiTest(t, "testdata/yamlv2")
18+
test := pulumitest.NewPulumiTest(t, "testdata/yamlv2", opttest.SkipInstall())
1819
t.Logf("into %s", test.Source())
1920
t.Cleanup(func() {
2021
test.Destroy()
@@ -26,7 +27,7 @@ func TestYamlV2(t *testing.T) {
2627
// TestJobUnreachable ensures that a panic does not occur when diffing Job resources against an unreachable API server.
2728
// https://github.com/pulumi/pulumi-kubernetes/issues/3022
2829
func TestJobUnreachable(t *testing.T) {
29-
test := pulumitest.NewPulumiTest(t, "testdata/job-unreachable")
30+
test := pulumitest.NewPulumiTest(t, "testdata/job-unreachable", opttest.SkipInstall())
3031
t.Logf("into %s", test.Source())
3132
t.Cleanup(func() {
3233
test.Destroy()

0 commit comments

Comments
 (0)