Skip to content

Commit 0019699

Browse files
test passes within 15 minutes timeout
1 parent 96dcb89 commit 0019699

File tree

2 files changed

+13
-69
lines changed

2 files changed

+13
-69
lines changed

tests/acc_test.go

+12-68
Original file line numberDiff line numberDiff line change
@@ -556,18 +556,18 @@ func TestE2eTs(t *testing.T) {
556556
previewResult := integrationTest.Preview(t)
557557
autogold.Expect(tc.previewExpect).Equal(t, previewResult.ChangeSummary)
558558

559-
//// Up
560-
//upResult := integrationTest.Up(t)
561-
//autogold.Expect(&tc.upExpect).Equal(t, upResult.Summary.ResourceChanges)
562-
//
563-
//// Preview expect no changes
564-
//previewResult = integrationTest.Preview(t)
565-
//t.Log(previewResult.StdOut)
566-
//autogold.Expect(tc.diffNoChangesExpect).Equal(t, previewResult.ChangeSummary)
567-
//
568-
//// Delete
569-
//destroyResult := integrationTest.Destroy(t)
570-
//autogold.Expect(&tc.deleteExpect).Equal(t, destroyResult.Summary.ResourceChanges)
559+
// Up
560+
upResult := integrationTest.Up(t)
561+
autogold.Expect(&tc.upExpect).Equal(t, upResult.Summary.ResourceChanges)
562+
563+
// Preview expect no changes
564+
previewResult = integrationTest.Preview(t)
565+
t.Log(previewResult.StdOut)
566+
autogold.Expect(tc.diffNoChangesExpect).Equal(t, previewResult.ChangeSummary)
567+
568+
// Delete
569+
destroyResult := integrationTest.Destroy(t)
570+
autogold.Expect(&tc.deleteExpect).Equal(t, destroyResult.Summary.ResourceChanges)
571571
})
572572
}
573573
}
@@ -724,62 +724,6 @@ func TestE2eGo(t *testing.T) {
724724
}
725725
}
726726

727-
// Some resources take minutes to provision and destroy.
728-
// TestPreview is for such resources, where we only verify that preview works as expected.
729-
func TestPreview(t *testing.T) {
730-
type testCase struct {
731-
name string // Must be same as project folder in testdata/programs/ts
732-
moduleName string
733-
moduleVersion string
734-
moduleNamespace string
735-
previewExpect map[apitype.OpType]int
736-
}
737-
738-
testcases := []testCase{
739-
{
740-
name: "rdsmod",
741-
moduleName: "terraform-aws-modules/rds/aws",
742-
moduleVersion: "6.10.0",
743-
moduleNamespace: "rds",
744-
previewExpect: map[apitype.OpType]int{
745-
apitype.OpType("create"): 6,
746-
},
747-
},
748-
}
749-
750-
for _, tc := range testcases {
751-
tc := tc
752-
localProviderBinPath := ensureCompiledProvider(t)
753-
skipLocalRunsWithoutCreds(t)
754-
t.Run(tc.name, func(t *testing.T) {
755-
testProgram := filepath.Join("testdata", "programs", "ts", tc.name)
756-
localPath := opttest.LocalProviderPath("terraform-module", filepath.Dir(localProviderBinPath))
757-
previewTest := pulumitest.NewPulumiTest(t, testProgram, localPath)
758-
759-
// Get a prefix for resource names
760-
prefix := generateTestResourcePrefix()
761-
762-
// Set prefix via config
763-
previewTest.SetConfig(t, "prefix", prefix)
764-
765-
// Generate package
766-
pulumiPackageAdd(
767-
t,
768-
previewTest,
769-
localProviderBinPath,
770-
tc.moduleName,
771-
tc.moduleVersion,
772-
tc.moduleNamespace)
773-
774-
// Preview
775-
previewResult := previewTest.Preview(t)
776-
t.Log(previewResult.StdOut)
777-
t.Log(previewResult.StdErr)
778-
autogold.Expect(tc.previewExpect).Equal(t, previewResult.ChangeSummary)
779-
})
780-
}
781-
}
782-
783727
func TestDiffDetail(t *testing.T) {
784728
// Set up a test Bucket
785729
localProviderBinPath := ensureCompiledProvider(t)

tests/testdata/programs/ts/rdsmod/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const config = new pulumi.Config();
55
const prefix = config.get('prefix') ?? pulumi.getStack();
66

77
const testrds = new rds.Module("test-rds", {
8-
identifier: `${prefix}test-rds-module`,
8+
identifier: `test-rds-module-${prefix}`,
99
engine: "mysql",
1010
instance_class: "db.t3.micro",
1111
allocated_storage: 20,

0 commit comments

Comments
 (0)