Skip to content

Commit f391d73

Browse files
committed
Added autoscaling tests.
1 parent 2d79755 commit f391d73

File tree

10 files changed

+1169
-11
lines changed

10 files changed

+1169
-11
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,20 @@ jobs:
4949
steps:
5050
- uses: actions/checkout@v5
5151

52+
- uses: actions/setup-python@v5
53+
with:
54+
python-version: '3.11'
55+
56+
- name: Install Python dependencies
57+
run: |
58+
pip install pytest pytest-timeout requests
59+
5260
- name: Start K3s cluster
5361
uses: jupyterhub/action-k3s-helm@v4
5462
with:
5563
k3s-channel: latest
5664
helm-version: ${{ env.HELM_VERSION }}
57-
metrics-enabled: false
65+
metrics-enabled: true
5866
docker-enabled: true
5967

6068
- name: Set release name
@@ -81,6 +89,13 @@ jobs:
8189
[ $counter -ge $timeout ] && { echo "❌ Timeout waiting for $crd"; exit 1; }
8290
done
8391
92+
# Wait for metrics-server to be ready (required for HPA)
93+
echo "Waiting for metrics-server..."
94+
kubectl wait --for=condition=Ready pod -l k8s-app=metrics-server -n kube-system --timeout=300s || {
95+
echo "⚠️ Metrics-server not ready, checking status..."
96+
kubectl get pods -n kube-system -l k8s-app=metrics-server
97+
}
98+
8499
echo "✅ K3s cluster ready"
85100
86101
- name: Deploy eoAPI
@@ -99,11 +114,21 @@ jobs:
99114
echo "=== Post-deployment validation ==="
100115
./scripts/test.sh check-deployment
101116
117+
- name: Install Python dependencies
118+
run: |
119+
python -m pip install --upgrade pip
120+
pip install pytest requests psycopg2-binary
121+
102122
- name: Run integration tests
103123
run: |
104124
export RELEASE_NAME="$RELEASE_NAME"
105125
./scripts/test.sh integration --debug
106126
127+
- name: Run autoscaling tests
128+
run: |
129+
export RELEASE_NAME="$RELEASE_NAME"
130+
python -m pytest .github/workflows/tests/test_autoscaling.py -v --tb=short -m "not slow"
131+
107132
- name: Debug failed deployment
108133
if: failure()
109134
run: |

0 commit comments

Comments
 (0)