Skip to content

[followup] Hoist docs-parity AST walker to internal/testhelpers/docsparity/ #141

Description

@trilamsr

Source: docs/followups/opportunistic.md row 13 (Next up).

The AST walker in components/receivers/dcgm/docs_parity_test.go (RUNBOOK ↔ IncError-kind parity, README ↔ example_config defaults) is the bar every new receiver should clear, but it's currently ~300 LOC inside dcgm. Moving it to internal/testhelpers/docsparity/ makes the bar invisible-to-explicit and saves the duplication on the second receiver author.

Trigger status (FIRED): kernelevents already maintains a parallel implementation at runbook_kinds_test.go — second caller exists today.

Files:

  • components/receivers/dcgm/docs_parity_test.go — source.
  • components/receivers/kernelevents/runbook_kinds_test.go — second caller (consolidate w/ source).
  • New: internal/testhelpers/docsparity/docsparity.go — exported API like docsparity.AssertParity(t, ReceiverPath, RunbookPath).

Coordinate with #137 (the AST walker resolveIncErrorCall CallExpr fix) — implement both in one refactor so the hoist captures the CallExpr handling.

Acceptance:

  • Both dcgm and kernelevents tests call the hoisted helper.
  • New receiver authors invoke it in a single line; no AST boilerplate to copy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions