E2E test expansion across CLI, daemon, and convert crates#60
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
convert,list-targets, andlist-formatssubcommands usingassert_cmd+insta/healthz,/readyz,/metrics,/api/v1/rules,/api/v1/status,/api/v1/reload) andPOST /api/v1/eventsingestion (single + batch NDJSON)--api-addr 127.0.0.1:0, so tests can discover the ephemeral portTotal: 40 new E2E/integration tests across
rsigma-cliandrsigma-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)