Skip to content

Commit

Permalink
Tests all the contour versions (#9)
Browse files Browse the repository at this point in the history
Adds integration tests for all the currently supported contour
versions.
  • Loading branch information
claudiubelu authored Jul 24, 2024
1 parent 7189f42 commit f9fd65f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/integration/test_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# import uuid
from pathlib import Path

import pytest
from k8s_test_harness import harness
from k8s_test_harness.util import env_util, exec_util, k8s_util

Expand All @@ -23,9 +24,10 @@
LOG = logging.getLogger(__name__)


def test_integration_contour(module_instance: harness.Instance):
@pytest.mark.parametrize("image_version", ("1.28.2", "1.26.1", "1.22.3"))
def test_integration_contour(function_instance: harness.Instance, image_version: str):
contour_rock = env_util.get_build_meta_info_for_rock_version(
"contour", "1.28.2", "amd64"
"contour", image_version, "amd64"
)

# This helm chart requires the registry to be separated from the image.
Expand All @@ -46,24 +48,24 @@ def test_integration_contour(module_instance: harness.Instance):
set_configs=[f"image.registry={registry}"],
)

module_instance.exec(helm_command)
function_instance.exec(helm_command)

# wait for envoy
k8s_util.wait_for_daemonset(module_instance, "contour-envoy", "contour")
k8s_util.wait_for_daemonset(function_instance, "contour-envoy", "contour")

# wait for contour
k8s_util.wait_for_deployment(module_instance, "contour-contour", "contour")
k8s_util.wait_for_deployment(function_instance, "contour-contour", "contour")

# deploy for httpbin
manifest = os.path.join("templates", "httpbin.yaml")
module_instance.exec(
function_instance.exec(
["k8s", "kubectl", "apply", "-f", "-"],
input=Path(manifest).read_bytes(),
)

result = (
exec_util.stubbornly(retries=5, delay_s=1)
.on(module_instance)
.on(function_instance)
.exec(
["k8s", "kubectl", "get", "svc", "httpbin", "-o", "json"],
capture_output=True,
Expand All @@ -74,7 +76,7 @@ def test_integration_contour(module_instance: harness.Instance):
awd = qwe["spec"]["clusterIP"]
resp = (
exec_util.stubbornly(retries=15, delay_s=5)
.on(module_instance)
.on(function_instance)
.exec(
[
"curl",
Expand Down

0 comments on commit f9fd65f

Please sign in to comment.