Skip to content

Commit ecbad98

Browse files
committed
try to split integration tests
1 parent 0e44f0d commit ecbad98

1 file changed

Lines changed: 45 additions & 6 deletions

File tree

.github/workflows/integration.yml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,42 @@ concurrency:
1717

1818
jobs:
1919
integration:
20-
name: Integration tests
20+
name: Integration (${{ matrix.name }})
2121
runs-on: ubuntu-24.04
22-
timeout-minutes: 45
22+
timeout-minutes: 30
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- name: lifecycle
28+
tests: >-
29+
full_restore_lifecycle
30+
invalid_kopia_secret_structure
31+
missing_kopia_secret_handled
32+
namespaces: >-
33+
test-lifecycle
34+
test-invalid-secret
35+
test-missing-secret
36+
needs_non_pg_snapshot: false
37+
38+
- name: error-paths
39+
tests: >-
40+
restore_fails_for_non_postgres_data
41+
snapshot_job_fails_for_wrong_bucket
42+
minimum_ttl_prevents_premature_restore
43+
namespaces: >-
44+
test-non-pg-data
45+
test-wrong-bucket
46+
test-min-ttl
47+
needs_non_pg_snapshot: true
48+
49+
- name: switchover
50+
tests: >-
51+
second_restore_and_switchover
52+
namespaces: >-
53+
test-switchover
54+
needs_non_pg_snapshot: false
55+
2356
steps:
2457
- uses: actions/checkout@v6
2558

@@ -117,6 +150,7 @@ jobs:
117150
echo "--- Kopia repository ready ---"
118151
119152
- name: Set up non-postgres kopia snapshot
153+
if: matrix.needs_non_pg_snapshot
120154
run: |
121155
kubectl apply -f tests/fixtures/setup-non-postgres-snapshot.yaml
122156
for i in $(seq 1 60); do
@@ -166,7 +200,12 @@ jobs:
166200
done
167201
168202
- name: Run integration tests
169-
run: cargo test --test integration -- --ignored --nocapture --test-threads=2
203+
run: |
204+
for test in ${{ matrix.tests }}; do
205+
echo "::group::Running $test"
206+
cargo test --test integration -- --ignored --nocapture --exact "$test"
207+
echo "::endgroup::"
208+
done
170209
env:
171210
RUST_LOG: info
172211

@@ -183,7 +222,7 @@ jobs:
183222
kubectl get ns
184223
185224
echo "=== All resources in test namespaces ==="
186-
for ns in test-lifecycle test-non-pg-data test-invalid-secret test-missing-secret test-wrong-bucket test-min-ttl test-switchover; do
225+
for ns in ${{ matrix.namespaces }}; do
187226
echo "--- Namespace: $ns ---"
188227
kubectl get all -n "$ns" 2>/dev/null || true
189228
done
@@ -204,13 +243,13 @@ jobs:
204243
kubectl get pvc -A -o wide 2>/dev/null || true
205244
206245
echo "=== Events in test namespaces ==="
207-
for ns in test-lifecycle test-non-pg-data test-invalid-secret test-missing-secret test-wrong-bucket test-min-ttl test-switchover; do
246+
for ns in ${{ matrix.namespaces }}; do
208247
echo "--- Events in $ns ---"
209248
kubectl get events -n "$ns" --sort-by=.lastTimestamp 2>/dev/null || true
210249
done
211250
212251
echo "=== Failed pod logs ==="
213-
for ns in test-lifecycle test-non-pg-data test-invalid-secret test-missing-secret test-wrong-bucket test-min-ttl test-switchover; do
252+
for ns in ${{ matrix.namespaces }}; do
214253
for pod in $(kubectl get pods -n "$ns" --no-headers -o custom-columns=":metadata.name" 2>/dev/null); do
215254
echo "--- Pod: $ns/$pod ---"
216255
kubectl logs -n "$ns" "$pod" --all-containers 2>/dev/null || true

0 commit comments

Comments
 (0)