Skip to content

fix(controller): add data_sink field to test-fixture AgentCollectorConfig constructors - #276

Merged
zzylol merged 1 commit into
mainfrom
fix/controller-test-baseline-data-sink-field
May 6, 2026
Merged

zzylol merged 1 commit into
mainfrom
fix/controller-test-baseline-data-sink-field

Conversation

@zzylol

@zzylol zzylol commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

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 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:

  • 7 sites use 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.
  • 2 sites pin AgentDataSink::PrometheusScrape { endpoint: "0.0.0.0:8889" } to keep the existing test semantics:
    • config::agent::tests::ddsketch_cfg — used by contains_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 — asserts doc["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, and controller/src/main.rs (test-code area). controller/src/types.rs left as-designed.

Sites updated (file:line)

  • controller/src/config/agent.rs:222ddsketch_cfg() (PrometheusScrape)
  • controller/src/config/agent.rs:301hll_processor
  • controller/src/config/agent.rs:331countminsketch_processor
  • controller/src/config/agent.rs:436kll_processor
  • controller/src/config/agent.rs:463countsketch_processor
  • controller/src/config/agent.rs:508all_sketch_types_processor_key_matches_pipeline_ref
  • controller/src/config/asapquery_backend.rs:190dummy_plan (also added AgentDataSink to the test-mod import list)
  • controller/src/config/precompute.rs:196dummy_plan
  • controller/src/main.rs:1282generated_agent_yaml_contains_opamp_extension (PrometheusScrape)

Test plan

  • cargo build --release -p controller clean (was already clean).
  • cargo test --release -p controller --no-run clean (was the blocker — 9 E0063 errors).
  • 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 (0.010000000000000009 != 0.01).
    • 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 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

…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>
@zzylol
zzylol merged commit a9eb9d1 into main May 6, 2026
@zzylol
zzylol deleted the fix/controller-test-baseline-data-sink-field branch May 9, 2026 18:00
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