trustgraph/tests/unit/test_gateway
cybermaggedon 9f84891fcc
Flow service lifecycle management (#822)
feat: separate flow service from config service with explicit queue
lifecycle management

The flow service is now an independent service that owns the lifecycle
of flow and blueprint queues. System services own their own queues.
Consumers never create queues.

Flow service separation:
- New service at trustgraph-flow/trustgraph/flow/service/
- Uses async ConfigClient (RequestResponse pattern) to talk to config
  service
- Config service stripped of all flow handling

Queue lifecycle management:
- PubSubBackend protocol gains create_queue, delete_queue,
  queue_exists, ensure_queue — all async
- RabbitMQ: implements via pika with asyncio.to_thread internally
- Pulsar: stubs for future admin REST API implementation
- Consumer _connect() no longer creates queues (passive=True for named
  queues)
- System services call ensure_queue on startup
- Flow service creates queues on flow start, deletes on flow stop
- Flow service ensures queues for pre-existing flows on startup

Two-phase flow stop:
- Phase 1: set flow status to "stopping", delete processor config
  entries
- Phase 2: retry queue deletion, then delete flow record

Config restructure:
- active-flow config replaced with processor:{name} types
- Each processor has its own config type, each flow variant is a key
- Flow start/stop use batch put/delete — single config push per
  operation
- FlowProcessor subscribes to its own type only

Blueprint format:
- Processor entries split into topics and parameters dicts
- Flow interfaces use {"flow": "topic"} instead of bare strings
- Specs (ConsumerSpec, ProducerSpec, etc.) read from
  definition["topics"]

Tests updated
2026-04-16 17:19:39 +01:00
..
test_auth.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_config_receiver.py Flow service lifecycle management (#822) 2026-04-16 17:19:39 +01:00
test_core_import_export_roundtrip.py Fix Metadata/EntityEmbeddings schema migration tail and add regression tests (#777) 2026-04-10 20:43:45 +01:00
test_dispatch_config.py Pub/sub abstraction: decouple from Pulsar (#751) 2026-04-01 20:16:53 +01:00
test_dispatch_manager.py Flow service lifecycle management (#822) 2026-04-16 17:19:39 +01:00
test_dispatch_mux.py Fix websocket error responses in Mux dispatcher (#726) 2026-03-28 10:58:28 +00:00
test_dispatch_requestor.py Fix tests (#593) 2025-12-19 08:53:21 +00:00
test_dispatch_sender.py Fix tests (#593) 2025-12-19 08:53:21 +00:00
test_dispatch_serialize.py Changed schema for Value -> Term, majorly breaking change (#622) 2026-01-27 13:48:08 +00:00
test_endpoint_constant.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_endpoint_i18n.py Feat: TrustGraph i18n & Documentation Translation Updates (#781) 2026-04-14 12:08:32 +01:00
test_endpoint_manager.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_endpoint_metrics.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_endpoint_socket.py Fix import export graceful shutdown (#476) 2025-08-28 13:39:28 +01:00
test_endpoint_stream.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_endpoint_variable.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_entity_contexts_import_dispatcher.py Fix Metadata/EntityEmbeddings schema migration tail and add regression tests (#777) 2026-04-10 20:43:45 +01:00
test_explain_triples.py Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00
test_graph_embeddings_import_dispatcher.py Fix Metadata/EntityEmbeddings schema migration tail and add regression tests (#777) 2026-04-10 20:43:45 +01:00
test_rows_import_dispatcher.py Remove redundant metadata (#685) 2026-03-11 10:51:39 +00:00
test_running.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_service.py Fix Metadata/EntityEmbeddings schema migration tail and add regression tests (#777) 2026-04-10 20:43:45 +01:00
test_socket_graceful_shutdown.py Fix test async warnings (#601) 2026-01-06 22:09:34 +00:00
test_streaming_translators.py Pub/sub abstraction: decouple from Pulsar (#751) 2026-04-01 20:16:53 +01:00
test_text_document_translator.py Pub/sub abstraction: decouple from Pulsar (#751) 2026-04-01 20:16:53 +01:00