Skip to content

Commit

Permalink
fix(autoscaling): Autoscaling test failure (#436)
Browse files Browse the repository at this point in the history
* fix: autoscalig acctest
  • Loading branch information
dusdjhyeon authored Aug 22, 2024
1 parent 17f222e commit de679f8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ resource "ncloud_subnet" "test" {
resource "ncloud_launch_configuration" "lc" {
server_image_product_code = "SW.VSVR.OS.LNX64.CNTOS.0703.B050"
server_product_code = "SVR.VSVR.STAND.C002.M008.NET.SSD.B050.G002"
}
resource "ncloud_auto_scaling_group" "auto" {
Expand Down
2 changes: 2 additions & 0 deletions internal/service/autoscaling/auto_scaling_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ resource "ncloud_subnet" "test" {
resource "ncloud_launch_configuration" "lc" {
server_image_product_code = "SW.VSVR.OS.LNX64.CNTOS.0703.B050"
server_product_code = "SVR.VSVR.STAND.C002.M008.NET.SSD.B050.G002"
}
resource "ncloud_auto_scaling_group" "auto" {
Expand Down Expand Up @@ -308,6 +309,7 @@ resource "ncloud_subnet" "test" {
resource "ncloud_launch_configuration" "lc" {
server_image_product_code = "SW.VSVR.OS.LNX64.CNTOS.0703.B050"
server_product_code = "SVR.VSVR.STAND.C002.M008.NET.SSD.B050.G002"
}
resource "ncloud_auto_scaling_group" "auto" {
Expand Down
2 changes: 2 additions & 0 deletions internal/service/autoscaling/auto_scaling_schedule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestAccResourceNcloudAutoScalingSchedule_classic_basic(t *testing.T) {
Config: testAccNcloudAutoScalingScheduleClassicConfig(name, start, end),
Check: resource.ComposeTestCheckFunc(
testAccCheckNcloudAutoScalingScheduleExists(resourceName, &schedule, GetTestProvider(false)),
resource.TestCheckResourceAttr(resourceName, "desired_capacity", "1"),
),
},
},
Expand Down Expand Up @@ -80,6 +81,7 @@ func TestAccResourceNcloudAutoScalingSchedule_classic_disappears(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckNcloudAutoScalingScheduleExists(resourceName, &schedule, GetTestProvider(false)),
TestAccCheckResourceDisappears(GetTestProvider(false), autoscaling.ResourceNcloudAutoScalingSchedule(), resourceName),
resource.TestCheckResourceAttr(resourceName, "desired_capacity", "1"),
),
ExpectNonEmptyPlan: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func testAccDataSourceNcloudLaunchConfigurationVpcConfig() string {
return `
resource "ncloud_launch_configuration" "lc" {
server_image_product_code = "SW.VSVR.OS.LNX64.CNTOS.0703.B050"
server_product_code = "SVR.VSVR.STAND.C002.M008.NET.SSD.B050.G002"
}
data "ncloud_launch_configuration" "lc" {
Expand Down
6 changes: 4 additions & 2 deletions internal/service/autoscaling/launch_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func TestAccResourceNcloudLaunchConfiguration_vpc_basic(t *testing.T) {
var launchConfiguration autoscaling.LaunchConfiguration
resourceName := "ncloud_launch_configuration.lc"
serverImageProductCode := "SW.VSVR.OS.LNX64.CNTOS.0703.B050"
serverProductCode := "SVR.VSVR.STAND.C002.M008.NET.SSD.B050.G002"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { TestAccPreCheck(t) },
ProtoV6ProviderFactories: ProtoV6ProviderFactories,
Expand All @@ -53,7 +54,7 @@ func TestAccResourceNcloudLaunchConfiguration_vpc_basic(t *testing.T) {
},
Steps: []resource.TestStep{
{
Config: testAccLaunchConfigurationConfig(serverImageProductCode, ""),
Config: testAccLaunchConfigurationConfig(serverImageProductCode, serverProductCode),
Check: resource.ComposeTestCheckFunc(
testAccCheckLaunchConfigurationExists(resourceName, &launchConfiguration, GetTestProvider(true)),
),
Expand Down Expand Up @@ -95,6 +96,7 @@ func TestAccResourceNcloudLaunchConfiguration_vpc_disappears(t *testing.T) {
var launchConfiguration autoscaling.LaunchConfiguration
resourceName := "ncloud_launch_configuration.lc"
serverImageProductCode := "SW.VSVR.OS.LNX64.CNTOS.0703.B050"
serverProductCode := "SVR.VSVR.STAND.C002.M008.NET.SSD.B050.G002"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { TestAccPreCheck(t) },
ProtoV6ProviderFactories: ProtoV6ProviderFactories,
Expand All @@ -103,7 +105,7 @@ func TestAccResourceNcloudLaunchConfiguration_vpc_disappears(t *testing.T) {
},
Steps: []resource.TestStep{
{
Config: testAccLaunchConfigurationConfig(serverImageProductCode, ""),
Config: testAccLaunchConfigurationConfig(serverImageProductCode, serverProductCode),
Check: resource.ComposeTestCheckFunc(
testAccCheckLaunchConfigurationExists(resourceName, &launchConfiguration, GetTestProvider(true)),
TestAccCheckResourceDisappears(GetTestProvider(true), autoscaling.ResourceNcloudLaunchConfiguration(), resourceName),
Expand Down

0 comments on commit de679f8

Please sign in to comment.