Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/tests/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 9 additions & 5 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down