1+ name : Helm Chart Integration Test
2+
3+ on :
4+ # Run on merge to main
5+ push :
6+ branches : [ main ]
7+ # Run on pull requests
8+ pull_request :
9+ branches : [ main ]
10+ # Run nightly at 2 AM UTC
11+ schedule :
12+ - cron : ' 0 2 * * *'
13+ # Allow manual trigger
14+ workflow_dispatch :
15+
16+ jobs :
17+ test-helm-chart :
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+
24+ - name : Set up Helm
25+ uses : azure/setup-helm@v3
26+ with :
27+ version : ' 3.12.0'
28+
29+ - name : Create kind cluster config
30+ run : |
31+ cat > kind-config.yaml << EOF
32+ kind: Cluster
33+ apiVersion: kind.x-k8s.io/v1alpha4
34+ nodes:
35+ - role: control-plane
36+ extraPortMappings:
37+ - containerPort: 30000
38+ hostPort: 3000
39+ protocol: TCP
40+ - containerPort: 30001
41+ hostPort: 4318
42+ protocol: TCP
43+ EOF
44+
45+ - name : Create kind cluster
46+ uses : helm/kind-action@v1
47+ with :
48+ cluster_name : hyperdx-test
49+ config : kind-config.yaml
50+
51+ - name : Install local-path-provisioner
52+ run : |
53+ kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.24/deploy/local-path-storage.yaml
54+ kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
55+
56+ - name : Run Helm unit tests
57+ run : |
58+ helm plugin install https://github.com/quintush/helm-unittest || true
59+ helm unittest charts/hdx-oss-v2
60+
61+ - name : Deploy HyperDX chart
62+ run : |
63+ # Create test values for faster deployment
64+ cat > test-values.yaml << EOF
65+ hyperdx:
66+ apiKey: "test-api-key-for-ci"
67+ appUrl: "http://localhost:3000"
68+ replicas: 1
69+
70+ clickhouse:
71+ persistence:
72+ enabled: true
73+ dataSize: 2Gi
74+ logSize: 1Gi
75+
76+ persistence:
77+ mongodb:
78+ enabled: true
79+ size: 2Gi
80+
81+ # Enable NodePort services for testing
82+ hyperdx:
83+ service:
84+ type: NodePort
85+ nodePort: 30000
86+
87+ otel:
88+ service:
89+ type: NodePort
90+ nodePort: 30001
91+ EOF
92+
93+ # Install the chart
94+ helm install hyperdx-test ./charts/hdx-oss-v2 -f test-values.yaml --timeout=2m
95+
96+ # Give services time to initialize after pods are running
97+ echo "Waiting for services to initialize..."
98+ sleep 20
99+
100+ - name : Verify deployment
101+ run : |
102+ # Wait for all pods to be ready
103+ kubectl wait --for=condition=Ready pods --all --timeout=300s
104+
105+ # Check pod status
106+ kubectl get pods -o wide
107+
108+ # Check services
109+ kubectl get services
110+
111+ - name : Run comprehensive smoke tests
112+ run : |
113+ # Make smoke test script executable
114+ chmod +x ./scripts/smoke-test.sh
115+
116+ # Run the smoke test with CI-specific environment
117+ RELEASE_NAME=hyperdx-test NAMESPACE=default ./scripts/smoke-test.sh
118+
119+ - name : Collect logs on failure
120+ if : failure()
121+ run : |
122+ echo "=== Pod Status ==="
123+ kubectl get pods -o wide
124+
125+ echo "=== Events ==="
126+ kubectl get events --sort-by=.metadata.creationTimestamp
127+
128+ echo "=== HyperDX App Logs ==="
129+ kubectl logs -l app=app --tail=100 || true
130+
131+ echo "=== ClickHouse Logs ==="
132+ kubectl logs -l app=clickhouse --tail=100 || true
133+
134+ echo "=== MongoDB Logs ==="
135+ kubectl logs -l app=mongodb --tail=100 || true
136+
137+ echo "=== OTEL Collector Logs ==="
138+ kubectl logs -l app=otel-collector --tail=100 || true
139+
140+ - name : Cleanup
141+ if : always()
142+ run : |
143+ helm uninstall hyperdx-test || true
144+ kind delete cluster --name hyperdx-test || true
0 commit comments