Kubernetes Integration Test #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Kubernetes Integration Test | |
| # This workflow tests the CORE semantic-router Kubernetes deployment. | |
| # | |
| # Test Scope: | |
| # ✅ Core deployment (namespace, pvc, deployment, service, configmap) | |
| # ✅ Manifest validation (kubeconform) | |
| # ✅ Service connectivity (gRPC, metrics, API ports) | |
| # ✅ API functionality testing (14 comprehensive tests) | |
| # ✅ Security scanning (Trivy, Checkov) | |
| # ✅ Basic syntax validation for observability and ai-gateway configs | |
| # ✅ kind cluster integration with CI-optimized configuration | |
| # ✅ Error handling and edge case testing | |
| # ✅ Performance testing with concurrent requests | |
| # | |
| # Out of Scope (planned for follow-up PRs): | |
| # 🔄 Observability stack deployment (Prometheus + Grafana) | |
| # 🔄 AI Gateway end-to-end testing (Envoy Gateway + InferencePool) | |
| # | |
| # CI Optimizations: | |
| # - Uses CI-specific kind configuration (single node, reduced resources) | |
| # - Generates kind-config.yaml dynamically (no models mount needed) | |
| # - Optimized for GitHub Actions runner constraints | |
| # - Modular workflow design for better maintainability | |
| on: | |
| pull_request: | |
| paths: | |
| - "deploy/kubernetes/**" | |
| - ".github/workflows/k8s-integration-test*.yml" | |
| - "Dockerfile.extproc" | |
| - "tools/kind/**" | |
| workflow_dispatch: # Allow manual triggering | |
| schedule: | |
| # Run nightly at 3:00 AM UTC | |
| - cron: "0 3 * * *" | |
| env: | |
| KIND_VERSION: v0.20.0 | |
| KUBECTL_VERSION: v1.28.0 | |
| KUSTOMIZE_VERSION: v5.7.1 | |
| jobs: | |
| # Step 1: Validate Kubernetes manifests | |
| validate-manifests: | |
| uses: ./.github/workflows/k8s-validate-manifests.yml | |
| with: | |
| kustomize_version: v5.7.1 | |
| # Step 2: Run kind cluster integration test | |
| kind-integration-test: | |
| uses: ./.github/workflows/k8s-kind-integration-test.yml | |
| needs: validate-manifests | |
| with: | |
| kind_version: v0.20.0 | |
| kustomize_version: v5.7.1 | |
| # Step 3: Run comprehensive API functionality tests | |
| # test-api-functionality: | |
| # uses: ./.github/workflows/k8s-api-functionality-test.yml | |
| # needs: kind-integration-test | |
| # with: | |
| # kind_version: v0.20.0 | |
| # kustomize_version: v5.7.1 | |
| # Step 4: Test with custom configurations | |
| test-with-custom-config: | |
| uses: ./.github/workflows/k8s-config-test.yml | |
| needs: validate-manifests | |
| with: | |
| kustomize_version: v5.7.1 | |
| # Step 5: Run security scans | |
| security-scan: | |
| uses: ./.github/workflows/k8s-security-scan.yml | |
| needs: validate-manifests | |
| with: | |
| kustomize_version: v5.7.1 | |
| # Step 6: Generate test summary | |
| summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: | |
| [ | |
| validate-manifests, | |
| kind-integration-test, | |
| test-with-custom-config, | |
| security-scan, | |
| ] | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| echo "=== Kubernetes Integration Test Summary ===" | |
| echo "Manifest Validation: ${{ needs.validate-manifests.result }}" | |
| echo "kind Integration Test: ${{ needs.kind-integration-test.result }}" | |
| echo "Custom Config Test: ${{ needs.test-with-custom-config.result }}" | |
| echo "Security Scan: ${{ needs.security-scan.result }}" | |
| # Count failures | |
| FAILURES=0 | |
| if [[ "${{ needs.validate-manifests.result }}" == "failure" ]]; then | |
| echo "❌ Manifest validation failed" | |
| FAILURES=$((FAILURES + 1)) | |
| fi | |
| if [[ "${{ needs.kind-integration-test.result }}" == "failure" ]]; then | |
| echo "❌ kind integration test failed" | |
| FAILURES=$((FAILURES + 1)) | |
| fi | |
| if [[ "${{ needs.test-with-custom-config.result }}" == "failure" ]]; then | |
| echo "❌ Custom config test failed" | |
| FAILURES=$((FAILURES + 1)) | |
| fi | |
| if [[ "${{ needs.security-scan.result }}" == "failure" ]]; then | |
| echo "❌ Security scan failed" | |
| FAILURES=$((FAILURES + 1)) | |
| fi | |
| echo "" | |
| echo "=== Test Coverage ===" | |
| echo "✅ Core deployment validation" | |
| echo "✅ Service connectivity testing" | |
| echo "✅ Configuration validation" | |
| echo "✅ Security scanning" | |
| echo "✅ Error handling and edge cases" | |
| echo "✅ Performance testing" | |
| if [ $FAILURES -gt 0 ]; then | |
| echo "" | |
| echo "❌ $FAILURES test(s) failed. Check the logs for details." | |
| exit 1 | |
| else | |
| echo "" | |
| echo "✅ All tests passed! Kubernetes deployment is fully validated." | |
| fi |