Skip to content

Commit c5df89b

Browse files
test(Lb/Backend): Removing unused ip declaration from the first step (#842)
In the first step, `scaleway_instance_ip.ip02` is not used so let's remove it. In fact, cassette is not able to distinguish the HTTP calls for `resource scaleway_instance_ip ip01 {}` and `resource scaleway_instance_ip ip02 {}` as they are identicals making the acceptance tests failing
1 parent 6895b35 commit c5df89b

File tree

4 files changed

+1613
-2175
lines changed

4 files changed

+1613
-2175
lines changed

scaleway/resource_instance_server_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ func TestAccScalewayInstanceServer_WithReservedIP(t *testing.T) {
599599
{
600600
Config: `
601601
resource "scaleway_instance_ip" "first" {}
602-
resource "scaleway_instance_ip" "second" {}
603602
resource "scaleway_instance_server" "base" {
604603
image = "ubuntu_focal"
605604
type = "DEV1-S"

scaleway/resource_lb_backend_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ func TestAccScalewayLbBackend_Basic(t *testing.T) {
2727
}
2828
2929
resource scaleway_instance_ip ip01 {}
30-
resource scaleway_instance_ip ip02 {}
3130
3231
resource scaleway_lb_backend bkd01 {
3332
lb_id = scaleway_lb.lb01.id
@@ -72,7 +71,7 @@ func TestAccScalewayLbBackend_Basic(t *testing.T) {
7271
forward_port_algorithm = "leastconn"
7372
sticky_sessions = "cookie"
7473
sticky_sessions_cookie_name = "session-id"
75-
server_ips = [ scaleway_instance_ip.ip02.address ]
74+
server_ips = [scaleway_instance_ip.ip01.address , scaleway_instance_ip.ip02.address ]
7675
proxy_protocol = "none"
7776
timeout_server = "1s"
7877
timeout_connect = "2.5s"
@@ -86,7 +85,8 @@ func TestAccScalewayLbBackend_Basic(t *testing.T) {
8685
`,
8786
Check: resource.ComposeTestCheckFunc(
8887
testAccCheckScalewayLbBackendExists(tt, "scaleway_lb_backend.bkd01"),
89-
resource.TestCheckResourceAttrPair("scaleway_lb_backend.bkd01", "server_ips.0", "scaleway_instance_ip.ip02", "address"),
88+
resource.TestCheckResourceAttrPair("scaleway_lb_backend.bkd01", "server_ips.0", "scaleway_instance_ip.ip01", "address"),
89+
resource.TestCheckResourceAttrPair("scaleway_lb_backend.bkd01", "server_ips.1", "scaleway_instance_ip.ip02", "address"),
9090
resource.TestCheckResourceAttr("scaleway_lb_backend.bkd01", "health_check_delay", "10s"),
9191
resource.TestCheckResourceAttr("scaleway_lb_backend.bkd01", "health_check_timeout", "15s"),
9292
resource.TestCheckResourceAttr("scaleway_lb_backend.bkd01", "health_check_port", "81"),

0 commit comments

Comments
 (0)