Skip to content

Commit

Permalink
Update tests to expect refresh changes for helm
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Jun 7, 2023
1 parent cb1642d commit 3451180
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
22 changes: 13 additions & 9 deletions tests/sdk/dotnet/dotnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ func TestDotnet_YamlLocal(t *testing.T) {

func TestDotnet_Helm(t *testing.T) {
test := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join("helm", "step1"),
Quick: true,
Dir: filepath.Join("helm", "step1"),
Quick: true,
ExpectRefreshChanges: true,
ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) {
// Ensure that all `Services` have `status` marked as a `Secret`
for _, res := range stackInfo.Deployment.Resources {
Expand All @@ -118,8 +119,9 @@ func TestDotnet_Helm(t *testing.T) {

func TestDotnet_HelmLocal(t *testing.T) {
test := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join("helm-local", "step1"),
Quick: true,
Dir: filepath.Join("helm-local", "step1"),
Quick: true,
ExpectRefreshChanges: true,
ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) {
assert.NotNil(t, stackInfo.Deployment)
assert.Equal(t, 12, len(stackInfo.Deployment.Resources))
Expand Down Expand Up @@ -164,8 +166,9 @@ func TestDotnet_HelmLocal(t *testing.T) {

func TestDotnet_HelmApiVersions(t *testing.T) {
test := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join("helm-api-versions", "step1"),
Quick: true,
Dir: filepath.Join("helm-api-versions", "step1"),
Quick: true,
ExpectRefreshChanges: true,
OrderedConfig: []integration.ConfigValue{
{
Key: "pulumi:disable-default-providers[0]",
Expand All @@ -183,9 +186,10 @@ func TestDotnet_HelmApiVersions(t *testing.T) {

func TestDotnet_HelmAllowCRDRendering(t *testing.T) {
test := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join("helm-skip-crd-rendering", "step1"),
Quick: true,
SkipRefresh: true,
Dir: filepath.Join("helm-skip-crd-rendering", "step1"),
Quick: true,
SkipRefresh: true,
ExpectRefreshChanges: true,
ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) {
assert.NotNil(t, stackInfo.Deployment)
assert.Equal(t, 8, len(stackInfo.Deployment.Resources))
Expand Down
35 changes: 21 additions & 14 deletions tests/sdk/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ func TestGo(t *testing.T) {

t.Run("Helm Local", func(t *testing.T) {
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-local", "step1"),
Quick: true,
Dir: filepath.Join(cwd, "helm-local", "step1"),
Quick: true,
ExpectRefreshChanges: true,
ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) {
// Verify resource creation order using the Event stream. The Chart resources must be created
// first, followed by the dependent ConfigMap. (The ConfigMap doesn't actually need the Chart, but
Expand Down Expand Up @@ -150,24 +151,27 @@ func TestGo(t *testing.T) {

t.Run("Helm Remote", func(t *testing.T) {
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm", "step1"),
Quick: true,
Dir: filepath.Join(cwd, "helm", "step1"),
Quick: true,
ExpectRefreshChanges: true,
})
integration.ProgramTest(t, &options)
})

t.Run("Helm Release", func(t *testing.T) {
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-release", "step1"),
Quick: true,
Dir: filepath.Join(cwd, "helm-release", "step1"),
Quick: true,
ExpectRefreshChanges: true,
})
integration.ProgramTest(t, &options)
})

t.Run("Helm Release With Empty Local Folder", func(t *testing.T) {
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-release", "step1"),
Quick: true,
Dir: filepath.Join(cwd, "helm-release", "step1"),
Quick: true,
ExpectRefreshChanges: true,
PrePulumiCommand: func(verb string) (func(err error) error, error) {
// Create an empty folder to test that the Helm provider doesn't fail when the folder is empty, and we should
// be fetching from remote.
Expand All @@ -183,16 +187,18 @@ func TestGo(t *testing.T) {

t.Run("Helm Release Local", func(t *testing.T) {
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-release-local", "step1"),
Quick: true,
Dir: filepath.Join(cwd, "helm-release-local", "step1"),
Quick: true,
ExpectRefreshChanges: true,
})
integration.ProgramTest(t, &options)
})

t.Run("Helm Release Local Compressed", func(t *testing.T) {
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-release-local-tar", "step1"),
Quick: true,
Dir: filepath.Join(cwd, "helm-release-local-tar", "step1"),
Quick: true,
ExpectRefreshChanges: true,
})
integration.ProgramTest(t, &options)
})
Expand Down Expand Up @@ -236,8 +242,9 @@ func TestGo(t *testing.T) {

t.Run("Helm API Versions", func(t *testing.T) {
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-api-versions", "step1"),
Quick: true,
Dir: filepath.Join(cwd, "helm-api-versions", "step1"),
Quick: true,
ExpectRefreshChanges: true,
})
integration.ProgramTest(t, &options)
})
Expand Down
12 changes: 8 additions & 4 deletions tests/sdk/python/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ func TestHelm(t *testing.T) {
t.FailNow()
}
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm", "step1"),
Dir: filepath.Join(cwd, "helm", "step1"),
ExpectRefreshChanges: true,
})
integration.ProgramTest(t, &options)
}
Expand All @@ -362,7 +363,8 @@ func TestHelmRelease(t *testing.T) {
t.FailNow()
}
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-release", "step1"),
Dir: filepath.Join(cwd, "helm-release", "step1"),
ExpectRefreshChanges: true,
EditDirs: []integration.EditDir{
{
Dir: filepath.Join(cwd, "helm-release", "step2"),
Expand All @@ -380,7 +382,8 @@ func TestHelmLocal(t *testing.T) {
t.FailNow()
}
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-local", "step1"),
Dir: filepath.Join(cwd, "helm-local", "step1"),
ExpectRefreshChanges: true,
ExtraRuntimeValidation: func(t *testing.T, stackInfo integration.RuntimeValidationStackInfo) {
// Verify resource creation order using the Event stream. The Chart resources must be created
// first, followed by the dependent ConfigMap. (The ConfigMap doesn't actually need the Chart, but
Expand Down Expand Up @@ -419,7 +422,8 @@ func TestHelmApiVersions(t *testing.T) {
t.FailNow()
}
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "helm-api-versions", "step1"),
Dir: filepath.Join(cwd, "helm-api-versions", "step1"),
ExpectRefreshChanges: true,
})
integration.ProgramTest(t, &options)
}
Expand Down

0 comments on commit 3451180

Please sign in to comment.