Files
sientia-dataops-orchestrato…/e2e
Eduardo Rios 9df151d29d SIENTIAPDE-2012: per-group levels/ignore_models_id filtering
Extends filter_notification_alerts (slot_manager.py) and
filter_notification_reports (formatters.py) to check
receiver_group.get('levels') and receiver_group.get('ignore_models_id'),
mirroring the existing contents/ignore pattern exactly. Closes the gap
SIENTIAPDE-2011 deliberately left open: the query-time union/intersection
filter widens what gets fetched for the union of all active groups, but until
now nothing narrowed each group back down to its own configured slice.

Both checks short-circuit via `not levels_list or ...` / `not
ignore_models_id_list or ...` rather than accessing notification['level']/
['model_id'] directly, so groups that don't configure either field (today's
common case, and every existing unit test fixture) never evaluate the
right-hand side and can't raise KeyError on notifications missing those keys.
ignore_models_id reads via `.get(...) or []`, defensively handling an
explicit `null` in a receiver_groups document from the start (same fix
SIENTIAPDE-2011 needed a follow-up commit for).

Tests:
- 8 new unit tests (4 per file): levels restriction, ignore_models_id
  restriction, neither-configured passthrough, explicit-None safety.
- New e2e test (test_scenario_a_2_1_per_group_levels_and_ignore_models_id)
  against real Mongo/Redis/Temporal: two active groups configured
  differently: SIENTIAPDE-2011's query-time filter widens the fetch to the
  union of both, and this subtask's per-group filter narrows each group back
  to its own levels/ignore_models_id, including the case where a model is
  ignored by only one of the active groups.
- Deduplicated the two e2e suites' identical _extract_html_body helper into
  e2e/helpers.py (extract_html_body), now shared by both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 13:46:03 -03:00
..
2026-05-22 15:02:16 -03:00
2026-05-22 15:02:16 -03:00
2026-05-22 15:02:16 -03:00
2026-05-22 15:02:16 -03:00
2026-05-22 15:02:16 -03:00
2026-05-22 15:02:16 -03:00
2026-05-22 15:02:16 -03:00

Orchestrator end-to-end tests

End-to-end tests run every external dependency for real (MongoDB, Redis, PostgreSQL via testcontainers; SMTP via in-process aiosmtpd; Temporal via WorkflowEnvironment.start_local()).

Requirements

  • Docker (for testcontainers)
  • Python dev dependencies: pip install -r requirements-dev.txt

Run locally

source ./venv/bin/activate
pytest e2e/ --override-ini testpaths=e2e -m e2e -v

Stop on first failure:

pytest e2e/ --override-ini testpaths=e2e -m e2e -x

Coverage (separate from unit tests)

COVERAGE_FILE=.coverage.e2e pytest e2e/ --override-ini testpaths=e2e -m e2e --cov=orchestrator --cov-branch
coverage combine .coverage .coverage.e2e
coverage report

Unit tests keep the default .coverage file; the E2E run must set COVERAGE_FILE=.coverage.e2e so reports do not overwrite each other.

Scenario catalog

See scenarios.md for numbered scenarios and which test module implements each case.