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.
This commit is contained in:
parent
f463020e3e
commit
0a400b976c
3 changed files with 54 additions and 1 deletions
49
.github/workflows/build.yml
vendored
49
.github/workflows/build.yml
vendored
|
|
@ -9,6 +9,7 @@ on:
|
||||||
tags: [ '*.*.*' ]
|
tags: [ '*.*.*' ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
workflow_dispatch: # Allow manual trigger
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# github.repository as <account>/<repo>
|
# github.repository as <account>/<repo>
|
||||||
|
|
@ -39,6 +40,54 @@ jobs:
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
uv run pytest -s tests/ -vv
|
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:
|
Build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: Test
|
needs: Test
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,7 @@ class KubernetesFixture:
|
||||||
|
|
||||||
def apply(self):
|
def apply(self):
|
||||||
"""Apply Kubernetes manifest"""
|
"""Apply Kubernetes manifest"""
|
||||||
|
print() # Newline for better test output formatting
|
||||||
# Create namespace if it doesn't exist
|
# Create namespace if it doesn't exist
|
||||||
if self.namespace != "default":
|
if self.namespace != "default":
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
|
|
@ -592,6 +593,7 @@ def k8s_jwt_validator_secret(kind_cluster) -> Generator[dict, None, None]:
|
||||||
jwt_pubkey_content = f.read()
|
jwt_pubkey_content = f.read()
|
||||||
|
|
||||||
# Create JWT secrets using kubectl
|
# Create JWT secrets using kubectl
|
||||||
|
print() # Newline for better test output formatting
|
||||||
print(" → Creating JWT secret 'jwt-pubkey-secret'...")
|
print(" → Creating JWT secret 'jwt-pubkey-secret'...")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[kubectl_cmd, "delete", "secret", "jwt-pubkey-secret", "-n", "default",
|
[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
|
# Build header-echo server image locally
|
||||||
header_echo_dir = BASE_DIR / "fixtures" / "header-echo"
|
header_echo_dir = BASE_DIR / "fixtures" / "header-echo"
|
||||||
|
print() # Newline for better test output formatting
|
||||||
print(" → Building header-echo-server:test image...")
|
print(" → Building header-echo-server:test image...")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["docker", "build", "-t", "header-echo-server:test", str(header_echo_dir)],
|
["docker", "build", "-t", "header-echo-server:test", str(header_echo_dir)],
|
||||||
|
|
|
||||||
|
|
@ -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
|
namespace: Namespace to create the secret in
|
||||||
pem_file: Path to the PEM file containing both certificate and key
|
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}...")
|
print(f" → Creating TLS secret '{secret_name}' from {pem_file.name}...")
|
||||||
|
|
||||||
# Read the PEM file
|
# Read the PEM file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue