Skip to content

Commit

Permalink
Clean up tests (hashicorp#2330)
Browse files Browse the repository at this point in the history
  • Loading branch information
arybolovlev authored Oct 27, 2023
1 parent f58204b commit 37984e8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 31 deletions.
16 changes: 7 additions & 9 deletions kubernetes/resource_kubernetes_deployment_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func TestAccKubernetesDeploymentV1_with_container_liveness_probe_using_exec(t *t
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.exec.0.command.0", "cat"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.exec.0.command.1", "/tmp/healthy"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.failure_threshold", "3"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.initial_delay_seconds", "5"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.initial_delay_seconds", "3"),
),
},
},
Expand Down Expand Up @@ -1359,7 +1359,8 @@ func testAccKubernetesDeploymentV1Config_basic(name, imageName string) string {
}
readiness_probe {
initial_delay_seconds = 5
initial_delay_seconds = 3
period_seconds = 1
http_get {
path = "/"
port = 80
Expand Down Expand Up @@ -1857,9 +1858,8 @@ func testAccKubernetesDeploymentV1ConfigWithLivenessProbeUsingExec(deploymentNam
exec {
command = ["cat", "/tmp/healthy"]
}
initial_delay_seconds = 5
period_seconds = 5
initial_delay_seconds = 3
period_seconds = 1
}
}
termination_grace_period_seconds = 1
Expand Down Expand Up @@ -1910,9 +1910,8 @@ func testAccKubernetesDeploymentV1ConfigWithLivenessProbeUsingHTTPGet(deployment
value = "Awesome"
}
}
initial_delay_seconds = 3
period_seconds = 3
period_seconds = 1
}
}
termination_grace_period_seconds = 1
Expand Down Expand Up @@ -1957,9 +1956,8 @@ func testAccKubernetesDeploymentV1ConfigWithLivenessProbeUsingTCP(deploymentName
tcp_socket {
port = 8080
}
initial_delay_seconds = 3
period_seconds = 3
period_seconds = 1
}
}
termination_grace_period_seconds = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ func TestAccKubernetesPersistentVolumeV1_hostPath_volumeSource(t *testing.T) {
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"metadata.0.resource_version"},
ProviderFactories: testAccProviderFactories,
ExternalProviders: testAccExternalProviders,
CheckDestroy: testAccCheckKubernetesPersistentVolumeV1Destroy,
Steps: []resource.TestStep{
{
Expand Down
18 changes: 7 additions & 11 deletions kubernetes/resource_kubernetes_pod_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ func TestAccKubernetesPodV1_with_container_liveness_probe_using_exec(t *testing.
resource.TestCheckResourceAttr(resourceName, "spec.0.container.0.liveness_probe.0.exec.0.command.0", "cat"),
resource.TestCheckResourceAttr(resourceName, "spec.0.container.0.liveness_probe.0.exec.0.command.1", "/tmp/healthy"),
resource.TestCheckResourceAttr(resourceName, "spec.0.container.0.liveness_probe.0.failure_threshold", "3"),
resource.TestCheckResourceAttr(resourceName, "spec.0.container.0.liveness_probe.0.initial_delay_seconds", "5"),
resource.TestCheckResourceAttr(resourceName, "spec.0.container.0.liveness_probe.0.initial_delay_seconds", "3"),
),
},
{
Expand Down Expand Up @@ -2036,9 +2036,8 @@ func testAccKubernetesPodV1ConfigWithLivenessProbeUsingExec(podName, imageName s
exec {
command = ["cat", "/tmp/healthy"]
}
initial_delay_seconds = 5
period_seconds = 5
initial_delay_seconds = 3
period_seconds = 1
}
}
termination_grace_period_seconds = 1
Expand Down Expand Up @@ -2073,9 +2072,8 @@ func testAccKubernetesPodV1ConfigWithLivenessProbeUsingHTTPGet(podName, imageNam
value = "Awesome"
}
}
initial_delay_seconds = 3
period_seconds = 3
period_seconds = 1
}
}
}
Expand Down Expand Up @@ -2103,9 +2101,8 @@ func testAccKubernetesPodV1ConfigWithLivenessProbeUsingTCP(podName, imageName st
tcp_socket {
port = 8080
}
initial_delay_seconds = 3
period_seconds = 3
period_seconds = 1
}
}
}
Expand Down Expand Up @@ -2134,9 +2131,8 @@ func testAccKubernetesPodV1ConfigWithLivenessProbeUsingGRPC(podName, imageName s
port = 8888
service = "EchoService"
}
initial_delay_seconds = 30
period_seconds = 30
initial_delay_seconds = 3
period_seconds = 1
}
}
}
Expand Down
13 changes: 5 additions & 8 deletions kubernetes/resource_kubernetes_replication_controller_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func TestAccKubernetesReplicationControllerV1_with_container_liveness_probe_usin
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.exec.0.command.0", "cat"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.exec.0.command.1", "/tmp/healthy"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.failure_threshold", "3"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.initial_delay_seconds", "5"),
resource.TestCheckResourceAttr(resourceName, "spec.0.template.0.spec.0.container.0.liveness_probe.0.initial_delay_seconds", "3"),
),
},
},
Expand Down Expand Up @@ -895,9 +895,8 @@ func testAccKubernetesReplicationControllerV1ConfigWithLivenessProbeUsingExec(rc
exec {
command = ["cat", "/tmp/healthy"]
}
initial_delay_seconds = 5
period_seconds = 5
initial_delay_seconds = 3
period_seconds = 1
}
}
}
Expand Down Expand Up @@ -945,9 +944,8 @@ func testAccKubernetesReplicationControllerV1ConfigWithLivenessProbeUsingHTTPGet
value = "Awesome"
}
}
initial_delay_seconds = 3
period_seconds = 3
period_seconds = 1
}
}
}
Expand Down Expand Up @@ -989,9 +987,8 @@ func testAccKubernetesReplicationControllerV1ConfigWithLivenessProbeUsingTCP(rcN
tcp_socket {
port = 8080
}
initial_delay_seconds = 3
period_seconds = 3
period_seconds = 1
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions kubernetes/resource_kubernetes_stateful_set_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ func testAccKubernetesStatefulSetV1ConfigBasic(name, imageName string) string {
}
readiness_probe {
initial_delay_seconds = 5
initial_delay_seconds = 3
period_seconds = 1
http_get {
path = "/"
port = 80
Expand Down Expand Up @@ -1116,7 +1117,8 @@ func testAccKubernetesStatefulSetV1ConfigWaitForRollout(name, imageName, waitFor
}
readiness_probe {
initial_delay_seconds = 5
initial_delay_seconds = 3
period_seconds = 1
tcp_socket {
port = 80
}
Expand Down

0 comments on commit 37984e8

Please sign in to comment.