Skip to content

Commit 2d79755

Browse files
authored
fix: fail integration tests properly. (#341)
1 parent 12f7097 commit 2d79755

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.github/workflows/tests/test_notifications.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,12 @@ def test_cloudevents_sink_logs_show_startup():
115115
pytest.skip("Cannot get Knative CloudEvents sink logs")
116116

117117
logs = result.stdout
118-
assert "listening on port" in logs, "Knative CloudEvents sink should have started successfully"
118+
# CloudEvents sink can be either a real sink or the helloworld sample container
119+
assert (
120+
"listening on port" in logs or "helloworld: received a request" in logs
121+
), (
122+
"Knative CloudEvents sink should be running (either real sink or helloworld sample)"
123+
)
119124

120125

121126
def test_eoapi_notifier_logs_show_connection():

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
### Changed
1919

2020
- Refactors eoapi-support into core eoapi chart [#262](https://github.com/developmentseed/eoapi-k8s/pull/262)
21+
- Make integration tests fail properly
2122

2223
## [0.7.13] - 2025-11-04
2324

scripts/test.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,24 @@ run_integration_tests() {
164164

165165
if ! command -v pytest >/dev/null 2>&1; then
166166
python3 -m pip install --user pytest psycopg2-binary requests >/dev/null 2>&1 || {
167-
log_warn "Failed to install pytest - skipping Python tests"
168-
return 0
167+
log_error "Failed to install pytest - cannot run integration tests"
168+
exit 1
169169
}
170170
fi
171171

172172
# Run notification tests (don't require DB connection)
173173
python3 -m pytest .github/workflows/tests/test_notifications.py::test_eoapi_notifier_deployment \
174174
.github/workflows/tests/test_notifications.py::test_cloudevents_sink_logs_show_startup \
175-
-v --tb=short || log_warn "Notification tests failed"
175+
-v --tb=short
176176
fi
177177

178178
# Wait for pods to be ready - try standard labels first, fallback to legacy
179179
if kubectl get pods -n "$NAMESPACE" >/dev/null 2>&1; then
180180
if ! wait_for_pods "$NAMESPACE" "app.kubernetes.io/name=eoapi,app.kubernetes.io/component=stac" "300s" 2>/dev/null; then
181-
wait_for_pods "$NAMESPACE" "app=${RELEASE_NAME}-stac" "300s" || log_warn "STAC pods not ready"
181+
wait_for_pods "$NAMESPACE" "app=${RELEASE_NAME}-stac" "300s" || {
182+
log_error "STAC pods not ready after timeout"
183+
exit 1
184+
}
182185
fi
183186
fi
184187

@@ -187,7 +190,8 @@ run_integration_tests() {
187190
if kubectl get ksvc eoapi-cloudevents-sink -n "$NAMESPACE" >/dev/null 2>&1; then
188191
log_info "Waiting for Knative cloudevents sink to be ready..."
189192
if ! kubectl wait --for=condition=Ready ksvc/eoapi-cloudevents-sink -n "$NAMESPACE" --timeout=120s 2>/dev/null; then
190-
log_warn "Knative cloudevents sink not ready - this may cause SinkBinding warnings"
193+
log_error "Knative cloudevents sink not ready after timeout"
194+
exit 1
191195
fi
192196
fi
193197
fi

0 commit comments

Comments
 (0)