Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests all the contour versions #9

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading