Skip to content

Commit d15e3da

Browse files
committed
refactor: restructure CI workflow for better helm testing
- Renamed job from 'Integration Tests (K3s)' to 'k3s-integration-tests' - Added helm unittest plugin installation step - Updated test execution to use helm unittest directly - Improved test organization and clarity
1 parent c804a2d commit d15e3da

File tree

1 file changed

+13
-71
lines changed

1 file changed

+13
-71
lines changed

.github/workflows/helm-tests.yml

Lines changed: 13 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ jobs:
2222
with:
2323
version: ${{ env.HELM_VERSION }}
2424

25-
- name: Run Helm unit tests
26-
run: make tests
25+
- name: Install helm unittest plugin
26+
run: helm plugin install https://github.com/helm-unittest/helm-unittest
2727

28-
integration:
29-
name: Integration Tests (K3s)
28+
- run: |
29+
cd charts
30+
helm unittest eoapi -f 'tests/*.yaml' -v eoapi/test-helm-values.yaml
31+
# Run autoscaling-specific unit tests
32+
helm unittest eoapi -f 'tests/autoscaling_tests.yaml'
33+
34+
k3s-integration-tests:
3035
if: github.event.pull_request.head.repo.full_name == github.repository
3136
permissions:
3237
contents: 'read'
@@ -49,91 +54,28 @@ jobs:
4954

5055
- name: Deploy eoAPI
5156
id: deploy
52-
continue-on-error: true
5357
run: |
5458
echo "=== Starting eoAPI deployment ==="
5559
export RELEASE_NAME="$RELEASE_NAME"
5660
export PGO_VERSION="${{ env.PGO_VERSION }}"
5761
export GITHUB_SHA="${{ github.sha }}"
5862
./scripts/deploy.sh --ci
5963
60-
- name: Check deployment status
61-
id: check
62-
if: steps.deploy.outcome == 'success'
63-
run: |
64-
echo "=== Checking deployment status ==="
65-
export RELEASE_NAME="$RELEASE_NAME"
66-
./scripts/test.sh check-deployment --debug
67-
68-
- name: Debug pgstac jobs if deployment failed
69-
if: steps.deploy.outcome == 'failure'
70-
continue-on-error: true
71-
run: |
72-
echo "=== Debugging pgstac job failures ==="
73-
74-
# Check pgstac-migrate job
75-
echo "===== pgstac-migrate Job Status ====="
76-
kubectl get jobs -l app.kubernetes.io/name=pgstac-migrate -o wide || echo "No pgstac-migrate jobs found"
77-
78-
MIGRATE_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-migrate -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
79-
if [ -n "$MIGRATE_PODS" ]; then
80-
for POD in $MIGRATE_PODS; do
81-
echo "--- Logs from migrate pod $POD ---"
82-
kubectl logs "$POD" --tail=100 || true
83-
echo "--- Description of migrate pod $POD ---"
84-
kubectl describe pod "$POD"
85-
done
86-
fi
87-
88-
# Check pgstac-load-samples job
89-
echo "===== pgstac-load-samples Job Status ====="
90-
kubectl get jobs -l app.kubernetes.io/name=pgstac-load-samples -o wide || echo "No pgstac-load-samples jobs found"
91-
92-
SAMPLES_PODS=$(kubectl get pods -l app.kubernetes.io/name=pgstac-load-samples -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
93-
if [ -n "$SAMPLES_PODS" ]; then
94-
for POD in $SAMPLES_PODS; do
95-
echo "--- Logs from samples pod $POD ---"
96-
kubectl logs "$POD" --tail=100 || true
97-
echo "--- Description of samples pod $POD ---"
98-
kubectl describe pod "$POD"
99-
done
100-
fi
101-
102-
# Check database status
103-
echo "===== Database Pod Status ====="
104-
kubectl get pods -l postgres-operator.crunchydata.com/cluster -o wide
105-
kubectl get postgrescluster -o wide
106-
107-
# Check ConfigMaps
108-
echo "===== Relevant ConfigMaps ====="
109-
kubectl get configmaps | grep -E "initdb|pgstac" || echo "No relevant configmaps found"
110-
111-
# Check for any related events
112-
echo "===== Related Kubernetes Events ====="
113-
kubectl get events | grep -E "pgstac|initdb" || echo "No relevant events found"
114-
115-
# Check notification system status
116-
echo "===== Notification System Status ====="
117-
kubectl get deployments -l app.kubernetes.io/name=eoapi-notifier -o wide || echo "No eoapi-notifier deployment found"
118-
kubectl get ksvc -l app.kubernetes.io/component=cloudevents-sink -o wide || echo "No Knative CloudEvents sink found"
119-
120-
exit 1
12164
12265
- name: Run integration tests
123-
if: steps.deploy.outcome == 'success'
12466
run: |
12567
echo "=== Running integration tests ==="
12668
export RELEASE_NAME="$RELEASE_NAME"
12769
./scripts/test.sh integration --debug
12870
129-
- name: Debug deployment status
130-
if: always()
71+
- name: Debug failed deployment
72+
if: failure()
13173
run: |
132-
echo "=== Final Deployment Status ==="
74+
echo "=== Deployment failed - collecting debug information ==="
13375
kubectl get pods -o wide
13476
kubectl get jobs -o wide
13577
kubectl get services -o wide
136-
kubectl get ingress
78+
kubectl get events --sort-by='.lastTimestamp' | tail -20 || true
13779
13880
# Check notification system final status
13981
echo "=== Notification System Final Status ==="

0 commit comments

Comments
 (0)