Skip to content

E2E test expansion across CLI, daemon, and convert crates#60

Merged
mostafa merged 7 commits into
mainfrom
feat/e2e-tests
May 1, 2026
Merged

E2E test expansion across CLI, daemon, and convert crates#60
mostafa merged 7 commits into
mainfrom
feat/e2e-tests

Conversation

@mostafa
Copy link
Copy Markdown
Member

@mostafa mostafa commented May 1, 2026

Summary

  • Add 14 snapshot-based CLI integration tests for convert, list-targets, and list-formats subcommands using assert_cmd + insta
  • Add 4 NATS E2E tests for the daemon binary via testcontainers (single detection, no-match silence, event_count correlation, fan-out)
  • Add 8 Postgres integration tests that convert Sigma rules to SQL and execute the queries against a real PostgreSQL instance via testcontainers, using the Okta cross-tenant impersonation scenario
  • Add 9 HTTP daemon E2E tests covering all REST API endpoints (/healthz, /readyz, /metrics, /api/v1/rules, /api/v1/status, /api/v1/reload) and POST /api/v1/events ingestion (single + batch NDJSON)
  • Add 5 input format tests for daemon and eval (syslog, plain, auto-detect)
  • Log the actual bound address (not the requested one) when the daemon starts with --api-addr 127.0.0.1:0, so tests can discover the ephemeral port

Total: 40 new E2E/integration tests across rsigma-cli and rsigma-convert.

Test plan

  • cargo test --test cli_convert (14 tests)
  • cargo test --test cli_daemon (14 tests, includes 3 new format tests)
  • cargo test --test cli_eval (29 tests, includes 2 new format tests)
  • cargo test --test cli_daemon_http (9 tests)
  • cargo test --features daemon-nats --test cli_daemon_nats (4 tests, requires Docker)
  • cargo test -p rsigma-convert --test postgres_integration (8 tests, requires Docker)
  • cargo test -p rsigma-convert --test golden_postgres (11 tests, no regressions)

mostafa added 7 commits May 1, 2026 01:16
Spawn the rsigma daemon as a child process with --input/--output
nats:// URLs pointed at a testcontainers NATS instance. Four tests
cover single detection, no-match silence, event_count correlation,
and fan-out to multiple output subjects.
Convert Sigma rules to SQL and execute the generated queries against a
real PostgreSQL instance. Uses the Okta cross-tenant impersonation
scenario with JSONB schema, 6 sample events, and 4 SigmaHQ detection
rules. Tests cover default format, VIEW creation, multi-rule conversion,
event_count correlation, and the no-match case.
…stion

Spawn the daemon with --input http and --api-addr 127.0.0.1:0, discover
the actual bound port from structured log output, and exercise all REST
endpoints: healthz, readyz, metrics, rules, status, reload, and POST
/api/v1/events with single and batch NDJSON payloads.

Also log the actual bound address instead of the requested one, so that
port-0 tests can discover the ephemeral port reliably.
@mostafa mostafa merged commit b461ff6 into main May 1, 2026
9 checks passed
@mostafa mostafa deleted the feat/e2e-tests branch May 1, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant