diff --git a/.github/workflows/tests/test_notifications.py b/.github/workflows/tests/test_notifications.py index 878844ac..4c44a427 100644 --- a/.github/workflows/tests/test_notifications.py +++ b/.github/workflows/tests/test_notifications.py @@ -115,7 +115,12 @@ def test_cloudevents_sink_logs_show_startup(): pytest.skip("Cannot get Knative CloudEvents sink logs") logs = result.stdout - assert "listening on port" in logs, "Knative CloudEvents sink should have started successfully" + # CloudEvents sink can be either a real sink or the helloworld sample container + assert ( + "listening on port" in logs or "helloworld: received a request" in logs + ), ( + "Knative CloudEvents sink should be running (either real sink or helloworld sample)" + ) def test_eoapi_notifier_logs_show_connection(): diff --git a/CHANGELOG.md b/CHANGELOG.md index ab0d5855..dd60893d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Refactors eoapi-support into core eoapi chart [#262](https://github.com/developmentseed/eoapi-k8s/pull/262) +- Make integration tests fail properly ## [0.7.13] - 2025-11-04 diff --git a/scripts/test.sh b/scripts/test.sh index d09ad0f5..874f7889 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -164,21 +164,24 @@ run_integration_tests() { if ! command -v pytest >/dev/null 2>&1; then python3 -m pip install --user pytest psycopg2-binary requests >/dev/null 2>&1 || { - log_warn "Failed to install pytest - skipping Python tests" - return 0 + log_error "Failed to install pytest - cannot run integration tests" + exit 1 } fi # Run notification tests (don't require DB connection) python3 -m pytest .github/workflows/tests/test_notifications.py::test_eoapi_notifier_deployment \ .github/workflows/tests/test_notifications.py::test_cloudevents_sink_logs_show_startup \ - -v --tb=short || log_warn "Notification tests failed" + -v --tb=short fi # Wait for pods to be ready - try standard labels first, fallback to legacy if kubectl get pods -n "$NAMESPACE" >/dev/null 2>&1; then if ! wait_for_pods "$NAMESPACE" "app.kubernetes.io/name=eoapi,app.kubernetes.io/component=stac" "300s" 2>/dev/null; then - wait_for_pods "$NAMESPACE" "app=${RELEASE_NAME}-stac" "300s" || log_warn "STAC pods not ready" + wait_for_pods "$NAMESPACE" "app=${RELEASE_NAME}-stac" "300s" || { + log_error "STAC pods not ready after timeout" + exit 1 + } fi fi @@ -187,7 +190,8 @@ run_integration_tests() { if kubectl get ksvc eoapi-cloudevents-sink -n "$NAMESPACE" >/dev/null 2>&1; then log_info "Waiting for Knative cloudevents sink to be ready..." if ! kubectl wait --for=condition=Ready ksvc/eoapi-cloudevents-sink -n "$NAMESPACE" --timeout=120s 2>/dev/null; then - log_warn "Knative cloudevents sink not ready - this may cause SinkBinding warnings" + log_error "Knative cloudevents sink not ready after timeout" + exit 1 fi fi fi