From 0a400b976ca6b2b2d6d092b09e70dcbe2fce8e41 Mon Sep 17 00:00:00 2001 From: Joao Gilberto Magalhaes Date: Thu, 12 Feb 2026 18:07:01 -0500 Subject: [PATCH] Add improved output formatting and new manual test workflows - Added blank lines before specific print statements in E2E test scripts for better readability. - Enabled `workflow_dispatch` in `.github/workflows/build.yml` to allow manual triggering of workflows. - Added separate jobs for running Docker Compose and Kubernetes E2E tests in CI pipeline. --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++++++++ tests_e2e/test_kubernetes.py | 3 +++ tests_e2e/utils.py | 3 ++- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f500c7d..61d6cc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ on: tags: [ '*.*.*' ] pull_request: branches: [ master ] + workflow_dispatch: # Allow manual trigger env: # github.repository as / @@ -39,6 +40,54 @@ jobs: export PATH="$HOME/.local/bin:$PATH" uv run pytest -s tests/ -vv + Tests-E2E-Docker: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' + timeout-minutes: 20 + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + + - name: Install dependencies + run: | + export PATH="$HOME/.local/bin:$PATH" + uv sync --group dev + + - name: Run Docker Compose E2E tests + run: | + export PATH="$HOME/.local/bin:$PATH" + uv run pytest tests_e2e/test_docker_compose.py -v + + Tests-E2E-Kubernetes: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' + timeout-minutes: 30 + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + + - name: Install dependencies + run: | + export PATH="$HOME/.local/bin:$PATH" + uv sync --group dev + + - name: Run Kubernetes E2E tests + run: | + export PATH="$HOME/.local/bin:$PATH" + uv run pytest tests_e2e/test_kubernetes.py -v + Build: runs-on: ubuntu-latest needs: Test diff --git a/tests_e2e/test_kubernetes.py b/tests_e2e/test_kubernetes.py index 9cb6598..d475a89 100644 --- a/tests_e2e/test_kubernetes.py +++ b/tests_e2e/test_kubernetes.py @@ -436,6 +436,7 @@ class KubernetesFixture: def apply(self): """Apply Kubernetes manifest""" + print() # Newline for better test output formatting # Create namespace if it doesn't exist if self.namespace != "default": subprocess.run( @@ -592,6 +593,7 @@ def k8s_jwt_validator_secret(kind_cluster) -> Generator[dict, None, None]: jwt_pubkey_content = f.read() # Create JWT secrets using kubectl + print() # Newline for better test output formatting print(" → Creating JWT secret 'jwt-pubkey-secret'...") subprocess.run( [kubectl_cmd, "delete", "secret", "jwt-pubkey-secret", "-n", "default", @@ -671,6 +673,7 @@ def k8s_cloudflare(kind_cluster, kind_cmd) -> Generator[str, None, None]: # Build header-echo server image locally header_echo_dir = BASE_DIR / "fixtures" / "header-echo" + print() # Newline for better test output formatting print(" → Building header-echo-server:test image...") subprocess.run( ["docker", "build", "-t", "header-echo-server:test", str(header_echo_dir)], diff --git a/tests_e2e/utils.py b/tests_e2e/utils.py index b943b5f..dca742d 100644 --- a/tests_e2e/utils.py +++ b/tests_e2e/utils.py @@ -109,7 +109,7 @@ def wait_for_pods_ready( if all_running: if verbose: label_info = f" (label: {label_selector})" if label_selector else "" - print(f"✓ All pods running in '{namespace}'{label_info}") + print(f" ✓ All pods running in '{namespace}'{label_info}") return True time.sleep(2) @@ -159,6 +159,7 @@ def create_tls_secret_from_pem(kubectl_cmd: str, secret_name: str, namespace: st namespace: Namespace to create the secret in pem_file: Path to the PEM file containing both certificate and key """ + print() # Newline for better test output formatting print(f" → Creating TLS secret '{secret_name}' from {pem_file.name}...") # Read the PEM file