Persistence: - one delivery state per sink, with claim, crash recovery, and index replacement - retention for delivered and dead records - LMDB writes moved off the event loop Pipeline: - one attempt per dispatch, with the next try scheduled by next_retry_at - backpressure through max_queue_size - reload re-reads YAML; SIGTERM drains and SIGHUP reloads Plugins: - journald source, enricher and filter processors, Loki sink - built-ins register when entry points are missing API and CLI: - health, metrics, per-sink queue, and dead-letter replay - startup prints the pipeline on one line Tests: - dispatch, plugins, metrics, CLI, and persistence coverage
26 lines
669 B
Python
26 lines
669 B
Python
from __future__ import annotations
|
|
|
|
from typer.testing import CliRunner
|
|
|
|
from daena.cli.main import app
|
|
|
|
runner = CliRunner()
|
|
|
|
|
|
def test_version_command() -> None:
|
|
result = runner.invoke(app, ["version"])
|
|
assert result.exit_code == 0
|
|
assert "daena v" in result.output
|
|
|
|
|
|
def test_status_reports_connection_failure() -> None:
|
|
result = runner.invoke(app, ["--target", "127.0.0.1:1", "status"])
|
|
assert result.exit_code == 1
|
|
assert "Cannot connect" in result.output
|
|
|
|
|
|
def test_records_rejects_unknown_kind() -> None:
|
|
result = runner.invoke(app, ["records", "other"])
|
|
assert result.exit_code == 2
|
|
assert "pending or dead" in result.output
|