Kubernetes Testing Infrastructure
This guide covers the K8s-native testing infrastructure for floe.
Test Execution Environments
Section titled “Test Execution Environments”┌─────────────────────────────────────────────────────────────────────────────┐│ UNIT TESTS ││ Environment: CI Runner (GitHub Actions ubuntu-latest) ││ Why: Fast, no infrastructure dependencies ││ Command: uv run pytest tests/unit │└─────────────────────────────────────────────────────────────────────────────┘ │ ▼┌─────────────────────────────────────────────────────────────────────────────┐│ INTEGRATION TESTS ││ Environment: Kind cluster in CI (ephemeral K8s) ││ Why: Real K8s networking, service discovery, pod lifecycle ││ Deployment: Helm install floe-platform (minimal: Dagster + DuckDB) ││ Execution: Test pods run inside the cluster ││ Command: kubectl apply -f tests/integration/test-job.yaml │└─────────────────────────────────────────────────────────────────────────────┘ │ ▼┌─────────────────────────────────────────────────────────────────────────────┐│ E2E TESTS ││ Environment: Kind cluster with FULL stack ││ Why: Production-identical infrastructure ││ Deployment: Helm install floe-platform (full: Dagster + Polaris + Cube) ││ Execution: Test pods run complete pipeline scenarios ││ Command: kubectl apply -f tests/e2e/test-job.yaml │└─────────────────────────────────────────────────────────────────────────────┘ │ ▼┌─────────────────────────────────────────────────────────────────────────────┐│ STAGING / PRE-PROD TESTS ││ Environment: Dedicated staging cluster (persistent) ││ Why: Long-running tests, performance benchmarks, soak tests ││ Deployment: Same Helm chart as production ││ Execution: Scheduled test jobs with production-like data volumes │└─────────────────────────────────────────────────────────────────────────────┘Test Pod Architecture
Section titled “Test Pod Architecture”Integration and E2E tests run as Kubernetes Jobs:
apiVersion: batch/v1kind: Jobmetadata: name: floe-integration-tests namespace: floe-testspec: backoffLimit: 0 # Fail fast, don't retry ttlSecondsAfterFinished: 3600 template: spec: restartPolicy: Never containers: - name: test-runner image: ghcr.io/floe/test-runner:latest command: ["pytest", "tests/integration", "-v", "--junitxml=/results/junit.xml"] env: - name: DAGSTER_HOST value: "dagster-webserver.floe-test.svc.cluster.local" - name: POLARIS_HOST value: "polaris.floe-test.svc.cluster.local" volumeMounts: - name: results mountPath: /results volumes: - name: results emptyDir: {}Key Points:
- Test pods run INSIDE the cluster, accessing services via K8s DNS
- Same network policies, resource limits, and security context as production
- Results exported via JUnit XML for CI integration
- Pods are ephemeral—created per test run, cleaned up after
Test Runner Image
Section titled “Test Runner Image”# tests/DockerfileFROM python:3.11-slim
# Install uvCOPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /appCOPY pyproject.toml uv.lock ./RUN uv sync --frozen
COPY tests/ tests/COPY src/ src/
ENTRYPOINT ["uv", "run", "pytest"]Local K8s Testing
Section titled “Local K8s Testing”Developers can run K8s tests locally:
# Create local Kind clusterkind create cluster --name floe-dev
# Deploy minimal stackhelm install floe-dev ./charts/floe-platform --set minimal=true
# Run testskubectl apply -f tests/integration/test-job.yamlkubectl logs -f job/integration-testsCI Resource Requirements
Section titled “CI Resource Requirements”| Job | Runner | Memory | Time |
|---|---|---|---|
| Unit | ubuntu-latest | 4GB | ~2min |
| Integration | ubuntu-latest | 8GB | ~5min |
| E2E | ubuntu-latest-8-cores | 16GB | ~12min |