fix(controller): add data_sink field to test-fixture AgentCollectorConfig constructors - #276
Merged
Merged
Conversation
…nfig constructors PR #204 added the `data_sink: AgentDataSink` field to `AgentCollectorConfig` (production sites updated) but missed nine test-fixture / test-code constructors, leaving `cargo test --release -p controller` blocked at compile-time. This broke the baseline for downstream PRs (#273, #274, #275) which could not run their newly added unit tests. Mechanical fill-in only, no semantic change to existing tests: - 7 sites use `AgentDataSink::default()` (Otlp-to-backend) — the canonical default that PR #204 introduced for new pipelines. - 2 sites (`config::agent::tests::ddsketch_cfg` and `main::api_tests::generated_agent_yaml_contains_opamp_extension`) pin `AgentDataSink::PrometheusScrape { endpoint: "0.0.0.0:8889" }` because their pre-existing assertions check for the legacy `prometheus` exporter on :8889. Pinning the sink keeps the test semantics intact rather than rewriting the asserts. After the fix: - `cargo build --release -p controller` clean. - `cargo test --release -p controller --no-run` clean (was the blocker). - `cargo test --release -p controller` runs 395 tests; 389 pass, 6 pre-existing failures unrelated to `data_sink`: * 2 in `analyzer::tests` — float-precision asserts. * 4 in `opamp::tests` / `api_tests` — protobuf framing ("invalid tag value: 0") on `ServerToAgent` decode. These are tracked separately and out of scope for this PR. - Newly-shipped tests now run end-to-end: `query_language` (8), `language_logical_plan` (6), `types_v2` (7), `algebra` (intent_algebra family, 6+). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
PR #204 added the
data_sink: AgentDataSinkfield toAgentCollectorConfig(production sites updated) but missed nine test-fixture / test-code constructors, leavingcargo test --release -p controllerblocked at compile-time. This was the baseline blocker that downstream PRs (#273, #274, #275) flagged — none of them could run their newly added unit tests until this lands.Mechanical fill-in only:
AgentDataSink::default()(Otlp-to-backend) — the canonical default that PR feat(e2e): all-five-sketch runtime path + harness — controller, processor, fake-exporter, P1–P9 #204 introduced for new pipelines.AgentDataSink::PrometheusScrape { endpoint: "0.0.0.0:8889" }to keep the existing test semantics:config::agent::tests::ddsketch_cfg— used bycontains_prometheus_exporter+pipeline_has_receivers_and_exporters, both of which assert the legacy prometheus exporter on :8889.main::api_tests::generated_agent_yaml_contains_opamp_extension— assertsdoc["exporters"]["prometheus"].is_mapping()at line ~1326.Touch boundary respected: only
controller/src/config/agent.rs,controller/src/config/asapquery_backend.rs,controller/src/config/precompute.rs, andcontroller/src/main.rs(test-code area).controller/src/types.rsleft as-designed.Sites updated (file:line)
controller/src/config/agent.rs:222—ddsketch_cfg()(PrometheusScrape)controller/src/config/agent.rs:301—hll_processorcontroller/src/config/agent.rs:331—countminsketch_processorcontroller/src/config/agent.rs:436—kll_processorcontroller/src/config/agent.rs:463—countsketch_processorcontroller/src/config/agent.rs:508—all_sketch_types_processor_key_matches_pipeline_refcontroller/src/config/asapquery_backend.rs:190—dummy_plan(also addedAgentDataSinkto the test-mod import list)controller/src/config/precompute.rs:196—dummy_plancontroller/src/main.rs:1282—generated_agent_yaml_contains_opamp_extension(PrometheusScrape)Test plan
cargo build --release -p controllerclean (was already clean).cargo test --release -p controller --no-runclean (was the blocker — 9 E0063 errors).cargo test --release -p controllerruns 395 tests: 389 pass, 6 pre-existing failures unrelated todata_sink:analyzer::tests— float-precision asserts (0.010000000000000009 != 0.01).opamp::tests/api_tests— protobuf framing ("invalid tag value: 0") onServerToAgentdecode.query_language(8 tests, all pass)language_logical_plan(6 tests, all pass)types_v2(7 tests, all pass)algebra(intent-algebra family —agg_intent_*,resolve_preserves_intent, all pass)cargo clippy --release -p controller --all-targets -- -D warnings— no NEW lints from the modified sites (the diff between baseline and post-fix surfaces only pre-existing dead-code warnings that the test target now exposes once it compiles).🤖 Generated with Claude Code