adjust tests according to comments
Signed-off-by: malpou <malthe@grundtvigsvej.dk>
This commit is contained in:
parent
3863a328c5
commit
ae760e5365
|
|
@ -119,13 +119,9 @@ func TestPlaceholderPages(t *testing.T) {
|
||||||
DeleteNamespace(t, testNamespace)
|
DeleteNamespace(t, testNamespace)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, testName, testNamespace, 1, 240, 3),
|
// Wait for the deployment to exist with 0 replicas
|
||||||
"deployment replicas should be 1 after 3 minutes")
|
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, testName, testNamespace, 0, 60, 3),
|
||||||
|
"deployment should exist with 0 replicas within 1 minute")
|
||||||
// Wait for the deployment to scale down to zero
|
|
||||||
time.Sleep(90 * time.Second)
|
|
||||||
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, testName, testNamespace, 0, 240, 3),
|
|
||||||
"deployment replicas should be 0 after 3 minutes")
|
|
||||||
|
|
||||||
// Make a request and verify placeholder is served
|
// Make a request and verify placeholder is served
|
||||||
testPlaceholderResponse(t)
|
testPlaceholderResponse(t)
|
||||||
|
|
@ -137,18 +133,13 @@ func TestPlaceholderPages(t *testing.T) {
|
||||||
func testPlaceholderResponse(t *testing.T) {
|
func testPlaceholderResponse(t *testing.T) {
|
||||||
t.Log("Testing placeholder page response")
|
t.Log("Testing placeholder page response")
|
||||||
|
|
||||||
var interceptorIP string
|
|
||||||
if UseIngressHost {
|
|
||||||
interceptorIP = ExternalIP
|
|
||||||
} else {
|
|
||||||
interceptorService := GetKubernetesServiceEndpoint(
|
interceptorService := GetKubernetesServiceEndpoint(
|
||||||
t,
|
t,
|
||||||
KubeClient,
|
KubeClient,
|
||||||
"keda-http-add-on-interceptor-proxy",
|
"keda-http-add-on-interceptor-proxy",
|
||||||
"keda",
|
"keda",
|
||||||
)
|
)
|
||||||
interceptorIP = interceptorService.IP
|
interceptorIP := interceptorService.IP
|
||||||
}
|
|
||||||
|
|
||||||
url := fmt.Sprintf("http://%s", interceptorIP)
|
url := fmt.Sprintf("http://%s", interceptorIP)
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
|
|
@ -190,18 +181,13 @@ func testPlaceholderResponse(t *testing.T) {
|
||||||
func testImmediatePlaceholderResponse(t *testing.T) {
|
func testImmediatePlaceholderResponse(t *testing.T) {
|
||||||
t.Log("Testing immediate placeholder page response on cold start")
|
t.Log("Testing immediate placeholder page response on cold start")
|
||||||
|
|
||||||
var interceptorIP string
|
|
||||||
if UseIngressHost {
|
|
||||||
interceptorIP = ExternalIP
|
|
||||||
} else {
|
|
||||||
interceptorService := GetKubernetesServiceEndpoint(
|
interceptorService := GetKubernetesServiceEndpoint(
|
||||||
t,
|
t,
|
||||||
KubeClient,
|
KubeClient,
|
||||||
"keda-http-add-on-interceptor-proxy",
|
"keda-http-add-on-interceptor-proxy",
|
||||||
"keda",
|
"keda",
|
||||||
)
|
)
|
||||||
interceptorIP = interceptorService.IP
|
interceptorIP := interceptorService.IP
|
||||||
}
|
|
||||||
|
|
||||||
url := fmt.Sprintf("http://%s", interceptorIP)
|
url := fmt.Sprintf("http://%s", interceptorIP)
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue