Skip to content

fix: Allow for custom otel collector environment variables (#46) #75

fix: Allow for custom otel collector environment variables (#46)

fix: Allow for custom otel collector environment variables (#46) #75

Workflow file for this run

name: Helm Chart Integration Test
on:
# Run on merge to main
push:
branches: [ main ]
# Run on pull requests
pull_request:
branches: [ main ]
# Run nightly at 2 AM UTC
schedule:
- cron: '0 2 * * *'
# Allow manual trigger
workflow_dispatch:
jobs:
test-helm-chart:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: '3.12.0'
- name: Create kind cluster config
run: |
cat > kind-config.yaml << EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30000
hostPort: 3000
protocol: TCP
- containerPort: 30001
hostPort: 4318
protocol: TCP
EOF
- name: Create kind cluster
uses: helm/kind-action@v1
with:
cluster_name: hyperdx-test
config: kind-config.yaml
- name: Install local-path-provisioner
run: |
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.24/deploy/local-path-storage.yaml
kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
- name: Run Helm unit tests
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git || true
helm unittest charts/hdx-oss-v2
- name: Deploy HyperDX chart
run: |
# Create test values for faster deployment
cat > test-values.yaml << EOF
hyperdx:
apiKey: "test-api-key-for-ci"
appUrl: "http://localhost:3000"
replicas: 1
clickhouse:
persistence:
enabled: true
dataSize: 2Gi
logSize: 1Gi
persistence:
mongodb:
enabled: true
size: 2Gi
# Enable NodePort services for testing
hyperdx:
service:
type: NodePort
nodePort: 30000
otel:
service:
type: NodePort
nodePort: 30001
EOF
# Install the chart
helm install hyperdx-test ./charts/hdx-oss-v2 -f test-values.yaml --timeout=2m
# Give services time to initialize after pods are running
echo "Waiting for services to initialize..."
sleep 20
- name: Verify deployment
run: |
# Wait for all pods to be ready
kubectl wait --for=condition=Ready pods --all --timeout=300s
# Check pod status
kubectl get pods -o wide
# Check services
kubectl get services
- name: Run comprehensive smoke tests
run: |
# Make smoke test script executable
chmod +x ./scripts/smoke-test.sh
# Run the smoke test with CI-specific environment
RELEASE_NAME=hyperdx-test NAMESPACE=default ./scripts/smoke-test.sh
- name: Collect logs on failure
if: failure()
run: |
echo "=== Pod Status ==="
kubectl get pods -o wide
echo "=== Events ==="
kubectl get events --sort-by=.metadata.creationTimestamp
echo "=== HyperDX App Logs ==="
kubectl logs -l app=app --tail=100 || true
echo "=== ClickHouse Logs ==="
kubectl logs -l app=clickhouse --tail=100 || true
echo "=== MongoDB Logs ==="
kubectl logs -l app=mongodb --tail=100 || true
echo "=== OTEL Collector Logs ==="
kubectl logs -l app=otel-collector --tail=100 || true
- name: Cleanup
if: always()
run: |
helm uninstall hyperdx-test || true
kind delete cluster --name hyperdx-test || true