Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not assume ExpectRefreshChanges: true for all tests #1567

Merged
merged 7 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/examples_dotnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ func TestAccAppServiceCs(t *testing.T) {
assert.Equal(t, body, "Hello Pulumi")
}),
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}
3 changes: 3 additions & 0 deletions examples/examples_go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func TestAccNetworkGo(t *testing.T) {
test := getGoBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "network-go"),

// TODO[pulumi/pulumi-azure#1569] refresh tries to edit subnets
SkipRefresh: true,
})

integration.ProgramTest(t, &test)
Expand Down
31 changes: 15 additions & 16 deletions examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ func TestAccLoadbalancer(t *testing.T) {
skipIfShort(t)
test := getJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "loadbalancer"),
RunUpdateTest: false, // the subresources now longer have a resource group in them
AllowEmptyPreviewChanges: true,
AllowEmptyUpdateChanges: true,
// TO-DO: (@stack72) there is a strangeness with lb.Loadbalancer and the FrontendIpConfiguration
Dir: filepath.Join(getCwd(t), "loadbalancer"),

// TODO[pulumi/pulumi-azure#1571] various issues with non-empty refresh.
SkipRefresh: true,
})

integration.ProgramTest(t, &test)
Expand Down Expand Up @@ -94,7 +93,7 @@ func TestAccTable(t *testing.T) {
Dir: filepath.Join(getCwd(t), "table"),
RunUpdateTest: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -111,7 +110,7 @@ func TestAccServicebusMigration(t *testing.T) {
},
},
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand Down Expand Up @@ -209,7 +208,7 @@ func TestAccTopic(t *testing.T) {
Dir: filepath.Join(getCwd(t), "topic"),
// RunUpdateTest: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -219,7 +218,7 @@ func TestAccTimer(t *testing.T) {
Dir: filepath.Join(getCwd(t), "timer"),
RunUpdateTest: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -229,7 +228,7 @@ func TestAccQueue(t *testing.T) {
Dir: filepath.Join(getCwd(t), "queue"),
RunUpdateTest: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand Down Expand Up @@ -260,7 +259,7 @@ func TestAccDurableFunctions(t *testing.T) {
Dir: filepath.Join(getCwd(t), "durable-functions"),
RunUpdateTest: false,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -286,7 +285,7 @@ func TestAccEventhub(t *testing.T) {
AllowEmptyPreviewChanges: true,
AllowEmptyUpdateChanges: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -296,7 +295,7 @@ func TestAccHttpExternal(t *testing.T) {
Dir: filepath.Join(getCwd(t), "http-external"),
RunUpdateTest: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -306,7 +305,7 @@ func TestAccHttpMulti(t *testing.T) {
Dir: filepath.Join(getCwd(t), "http-multi"),
RunUpdateTest: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -321,7 +320,7 @@ func TestAccSecretCapture(t *testing.T) {
assert.NotContains(t, "s3cr3t", string(byts))
},
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand All @@ -331,7 +330,7 @@ func TestAccLinuxVirtualMachines(t *testing.T) {
Dir: filepath.Join(getCwd(t), "linux-virtual-machine"),
RunUpdateTest: true,
})

skipRefresh(&test)
integration.ProgramTest(t, &test)
}

Expand Down
10 changes: 9 additions & 1 deletion examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func getBaseOptions(t *testing.T) integration.ProgramTestOptions {
environ := getEnviron(t)
azureLocation := getLocation(t)
return integration.ProgramTestOptions{
ExpectRefreshChanges: true,
Config: map[string]string{
"azure:environment": environ,
"azure:location": azureLocation,
Expand Down Expand Up @@ -83,3 +82,12 @@ func validateAPITest(isValid func(body string)) func(t *testing.T, stack integra
isValid(string(body))
}
}

// A lot of tests currently generate non-empty diffs upon refresh. While the work of root-causing
// each individual test has not been done yet, a few common known causes are listed here:
//
// TODO[pulumi/pulumi-terraform-bridge#1595]
// TODO[pulumi/pulumi-azure#1568]
func skipRefresh(opts *integration.ProgramTestOptions) {
opts.SkipRefresh = true
}
6 changes: 3 additions & 3 deletions examples/loadbalancer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ const backendPool = new azure.lb.BackendAddressPool("backendPool", {
const tcp = new azure.lb.NatRule("tcp", {
resourceGroupName: resourceGroup.name,
loadbalancerId: lb.id,
protocol: "tcp",
protocol: "Tcp",
frontendPort: 5000,
backendPort: 3389,
frontendIpConfigurationName: "LoadBalancerFrontEnd",
});

const lbprobe = new azure.lb.Probe("lbprobe", {
loadbalancerId: lb.id,
protocol: "tcp",
protocol: "Tcp",
port: 80,
intervalInSeconds: 5,
numberOfProbes: 2,
});

const lbrule = new azure.lb.Rule("lbrule", {
loadbalancerId: lb.id,
protocol: "tcp",
protocol: "Tcp",
frontendPort: 80,
backendPort: 80,
frontendIpConfigurationName: "LoadBalancerFrontEnd",
Expand Down
Loading