|
| 1 | +--- |
| 2 | +name: Helm Integration Tests |
| 3 | + |
| 4 | +'on': |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - 'charts/**' |
| 8 | + - '.github/workflows/test-helm.yaml' |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - master |
| 12 | + paths: |
| 13 | + - 'charts/**' |
| 14 | + |
| 15 | +jobs: |
| 16 | + helm-integration-tests: |
| 17 | + name: Helm Integration Tests |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout Code |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + |
| 26 | + - name: Set up Helm |
| 27 | + uses: azure/setup-helm@v4 |
| 28 | + with: |
| 29 | + version: 'latest' |
| 30 | + |
| 31 | + - name: Set up chart-testing |
| 32 | + |
| 33 | + |
| 34 | + - name: Add chart dependencies |
| 35 | + run: | |
| 36 | + # Add JobSet repository as mentioned in the original PR |
| 37 | + helm repo add jobset https://kubernetes-sigs.github.io/jobset |
| 38 | + helm repo update |
| 39 | +
|
| 40 | + - name: Determine target branch |
| 41 | + id: get_branch |
| 42 | + run: | |
| 43 | + if [ "${{ github.event_name }}" == "push" ]; then |
| 44 | + BRANCH="${{ github.ref_name }}" |
| 45 | + elif [ "${{ github.event_name }}" == "pull_request" ]; then |
| 46 | + BRANCH="${{ github.base_ref }}" |
| 47 | + else |
| 48 | + BRANCH="master" |
| 49 | + fi |
| 50 | + echo "Target branch: $BRANCH" |
| 51 | + echo "BRANCH=$BRANCH" >> "$GITHUB_OUTPUT" |
| 52 | +
|
| 53 | + - name: Run make generate (includes helm-docs) |
| 54 | + run: | |
| 55 | + # This was mentioned in the original PR commits |
| 56 | + if make help 2>/dev/null | grep -q "generate"; then |
| 57 | + make generate |
| 58 | + else |
| 59 | + echo "No generate target found, continuing..." |
| 60 | + fi |
| 61 | +
|
| 62 | + - name: Create kind cluster |
| 63 | + run: | |
| 64 | + # Follow the pattern from original PR |
| 65 | + if make help 2>/dev/null | grep -q "test-e2e-setup-cluster"; then |
| 66 | + echo "Using project's cluster setup..." |
| 67 | + make test-e2e-setup-cluster |
| 68 | + else |
| 69 | + echo "Setting up Kind cluster..." |
| 70 | + kind create cluster --name chart-testing --wait 300s |
| 71 | + kubectl cluster-info --context kind-chart-testing |
| 72 | + fi |
| 73 | +
|
| 74 | + - name: Run chart-testing (lint and install) |
| 75 | + env: |
| 76 | + BRANCH: ${{ steps.get_branch.outputs.BRANCH }} |
| 77 | + run: | |
| 78 | + # Use the combined command with configuration file |
| 79 | + ct lint-and-install \ |
| 80 | + --config .github/ct.yaml \ |
| 81 | + --target-branch $BRANCH \ |
| 82 | + --debug |
| 83 | +
|
| 84 | + - name: Verify Helm installation |
| 85 | + run: | |
| 86 | + echo "=== Cluster Status ===" |
| 87 | + kubectl get nodes -o wide |
| 88 | +
|
| 89 | + echo "=== Namespaces ===" |
| 90 | + kubectl get namespaces |
| 91 | +
|
| 92 | + echo "=== All Pods ===" |
| 93 | + kubectl get pods --all-namespaces -o wide |
| 94 | +
|
| 95 | + echo "=== Training Operator Pods ===" |
| 96 | + kubectl get pods -n kubeflow-system \ |
| 97 | + -l app.kubernetes.io/name=kubeflow-trainer || true |
| 98 | +
|
| 99 | + echo "=== JobSet Pods ===" |
| 100 | + kubectl get pods -n kubeflow-system \ |
| 101 | + -l app.kubernetes.io/name=jobset || true |
| 102 | +
|
| 103 | + echo "=== Services ===" |
| 104 | + kubectl get svc --all-namespaces |
| 105 | +
|
| 106 | + echo "=== CRDs ===" |
| 107 | + kubectl get crd | grep -E "(training|jobset)" || \ |
| 108 | + echo "No training/jobset CRDs found" |
| 109 | +
|
| 110 | + - name: Run basic functionality tests |
| 111 | + run: | |
| 112 | + echo "=== Testing Chart Installation ===" |
| 113 | + # Test the specific installation command from the original PR |
| 114 | + helm upgrade kubeflow-trainer charts/kubeflow-trainer \ |
| 115 | + --install \ |
| 116 | + --dependency-update \ |
| 117 | + --namespace kubeflow-system \ |
| 118 | + --create-namespace \ |
| 119 | + --wait \ |
| 120 | + --timeout 300s \ |
| 121 | + --set jobset.install=true \ |
| 122 | + --dry-run |
| 123 | +
|
| 124 | + echo "Chart validation successful!" |
| 125 | +
|
| 126 | + - name: Cleanup |
| 127 | + if: always() |
| 128 | + run: | |
| 129 | + echo "Cleaning up resources..." |
| 130 | + kubectl delete namespace kubeflow-system \ |
| 131 | + --ignore-not-found=true || true |
| 132 | + kind delete cluster --name chart-testing || true |
0 commit comments