test: integration/E2E tests for dynamic pipelines daemon#90
Merged
Conversation
16 end-to-end tests covering the full dynamic pipeline lifecycle:
- Source resolution at startup with var expansion and detection
- No false positives with non-matching events
- Reload preserves dynamic detection
- Source file change triggers updated detection after reload
- Error policy use_cached serves stale data when source disappears
- Required source with on_error:fail causes daemon exit
- API /sources/resolve triggers re-resolution
- /status includes dynamic_sources summary
- Prometheus metrics include source resolution counters
- DELETE /sources/cache/{id} invalidates cache
- GET /sources returns source list
- Include expansion injects transformations from source
- CLI resolve command and --dry-run flag
- CLI validate --resolve-sources for reachable/unreachable sources
Root cause fix: DaemonProcess stderr handling now uses a reader
thread to keep the pipe alive, preventing SIGPIPE from disrupting
the daemon's reload handler during source re-resolution.
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
crates/rsigma-cli/tests/cli_daemon_dynamic.rscovering the full dynamic pipeline lifecycle: source resolution at startup, detection with dynamically-resolved vars, source refresh on file change, reload preservation, error policy enforcement (use_cached, fail), API-triggered re-resolution, include expansion for dynamic transformations, Prometheus metrics, cache invalidation, and CLI commands (resolve, validate --resolve-sources).DaemonProcess::spawndropped the stderr pipe reader after startup detection, causing the daemon's reload handler to fail silently when trying to log. The new implementation uses a background reader thread to keep the pipe alive.Test plan
cargo test -p rsigma --test cli_daemon_dynamic -- --test-threads=1)cargo test -p rsigma --test cli_daemon_http)cargo test --workspace)cargo clippy --workspace --all-targets --all-features -- -D warnings)cargo fmt --all -- --check)