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

Compute - Fix failed Acc Test #27465

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func TestAccVirtualMachine_ChangeAvailabilitySet(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_virtual_machine", "test")
r := VirtualMachineResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
data.ResourceTestIgnoreRecreate(t, r, []acceptance.TestStep{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't actually test anything in the resource, rather it is testing Terraform's ForceNew action, so I think the test should actually be removed as it is providing no value to the resource.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

{
Config: r.withAvailabilitySet(data),
Check: acceptance.ComposeTestCheckFunc(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func TestAccVirtualMachineScaleSet_verify_key_data_changed(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_virtual_machine_scale_set", "test")
r := VirtualMachineScaleSetResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
data.ResourceTestIgnoreRecreate(t, r, []acceptance.TestStep{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is also invalid. The schema is a set (since it has a max items of 1, it seems it should should be a list). Given this is a deprecated resource, and not receiving any fixes, I believe this test is safe to remove rather than paper over the problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

{
Config: r.linux(data),
Check: acceptance.ComposeTestCheckFunc(
Expand Down Expand Up @@ -3530,6 +3530,9 @@ resource "azurerm_application_gateway" "test" {
timeout = 120
interval = 300
unhealthy_threshold = 8
match {
status_code = ["200-399"]
}
Comment on lines +3392 to +3394
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test this relates to sometimes passes, do we know why this optional property is sometimes returned and sometimes not from the API?

Copy link
Contributor Author

@ms-zhenhua ms-zhenhua Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this default value was recently added by Azure Team because other azurerm_application_gateway.probe related testcases like TestAccApplicationGateway_probesWithPort also failed due to this reason. However, this default value is consistent with the document .

}

request_routing_rule {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func TestAccVirtualMachine_deleteVHDOptIn(t *testing.T) {
func TestAccVirtualMachine_ChangeComputerName(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_virtual_machine", "test")
r := VirtualMachineResource{}
data.ResourceTest(t, r, []acceptance.TestStep{
data.ResourceTestIgnoreRecreate(t, r, []acceptance.TestStep{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this test just cycles a ForceNew property, and doesn't provide any resource value since Terraform will always just delete and recreate it. We should remove the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

{
Config: r.machineNameBeforeUpdate(data),
Check: acceptance.ComposeTestCheckFunc(
Expand Down Expand Up @@ -322,7 +322,7 @@ func TestAccVirtualMachine_changeOSDiskVhdUri(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_virtual_machine", "test")
r := VirtualMachineResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
data.ResourceTestIgnoreRecreate(t, r, []acceptance.TestStep{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again here. This test doesn't provide any value to the resource functionality as it just triggers a ForceNew on the schema, which will always have the same outcome. This test should just be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

{
Config: r.basicLinuxMachine(data),
Check: acceptance.ComposeTestCheckFunc(
Expand Down
Loading