datadog/e2e-audit
Judge whether Agent behavior belongs in a new-e2e, integration, or unit test
npx skills add https://github.com/DataDog/datadog-agent --skill e2e-audit
Decide whether assertions about proposed or existing Agent behavior belong in
a full new-e2e test, an integration test, or a unit test. Produce only a
verdict and rationale. Never edit, move, or delete tests.
Analyze observable claims and failure modes, not entire test files or individual
assert or require calls. Group checks that validate the same contract as one
assertion, including implicit claims such as successful installation, startup,
or command execution.
Choose the cheapest test that preserves the boundary and failure mode that
matter. Do not ask only whether an assertion *can* be made with mocks; ask what
the assertion would stop validating if its dependencies were replaced.
Use new-e2e when the deployed Agent or its real environment is part of the
behavior being validated. This includes boundaries such as:
that depends on the running Agent;
that cannot be represented faithfully by a local dependency;
configuration, encoding, or forwarding path is material to the test.
A behavior is not E2E-worthy merely because the current test reaches it through
SSH, a CLI, or remote infrastructure. If those layers add no relevant coverage,
use a lower-level test.
Use an integration test when the important boundary can be preserved locally,
for example by wiring components with fx.Test, using a local fakeintake, or
using a real local daemon, driver, or hardware dependency. A real local
dependency does not by itself require new-e2e.
Use a unit test when the behavior is isolated logic and does not require a real
component graph, process, or external dependency.
Duplicating an E2E assertion in a unit or integration test is useful when the
lower-level test preserves its failure mode: it provides faster PR feedback,
more deterministic failures, and easier debugging. Do not treat this useful
duplication as waste by itself.
After identifying lower-level coverage, reevaluate what the E2E test uniquely
validates. Repeating the same assertion through the deployed Agent can still be
valuable when it catches assembly, configuration, packaging, lifecycle, or
forwarding failures that the lower-level test cannot. If nearly all material
assertions have equivalent lower-level coverage and the E2E test preserves no
meaningful additional boundary, its feedback no longer justifies its
provisioning, runtime, and maintenance cost; recommend removing it. Base this
decision on residual failure coverage, not only the number of duplicated
assertions.
would be lost in a lower-level test.
boundary.
If the description does not establish the relevant assertions or boundaries,
ask for the missing information or return an explicitly uncertain verdict.
*_test.go files.Follow shared suites, setup code, helpers, and provisioners rather than
judging files in isolation.
and cleanup. Inspect the production code it exercises before deciding that
an assertion can be tested at a lower level.
setup and lifecycle operations, and group checks that cover the same
contract.
environment that preserves that failure, note equivalent lower-level
coverage, and classify it using the principle above.
name the assertion and boundary that determine this verdict.
provide faster PR feedback, more deterministic failures, or easier
debugging, even if the suite initially remains E2E.
and real boundaries that only the E2E test preserves. If nearly all material
assertions are duplicated and no meaningful E2E-only boundary remains,
recommend removing the E2E test. Weigh its residual value against runtime,
provisioning, flakiness, and maintenance cost; do not assume all cost is
paid only once at suite setup.
equivalent coverage that could be consolidated.
For large reviews, inspect files in parallel if possible, then verify and
synthesize the results.
Use one of these verdicts:
For proposed behavior, classify each expected assertion and return an overall
verdict with a short reason. For existing tests, classify each material
assertion and return one verdict per concrete suite, naming the assertion and
boundary that determine it. State what the E2E test uniquely validates after
accounting for lower-level coverage, or say that no material E2E-only boundary
remains. When several assertions differ, use a concise table with these
columns: assertion, failure caught, smallest environment, and classification.
Add only material uncertainty, lower-level candidates, or consolidation
opportunities.
Input: Verify that installing the Agent package creates a running service
with the expected permissions and that data reaches fakeintake after a reboot.
Output: E2E justified — The package installation, service lifecycle,
permissions, reboot, and forwarding path are the behavior under test; a
lower-level test would not preserve those deployed-system boundaries.
Input: Verify that the assembled Agent components transform a payload and
send it to a local fakeintake.
Output: Should be an integration test — A locally assembled component
graph and fakeintake preserve the component wiring and payload boundary without
provisioning remote infrastructure.
Input: Verify that the configuration parser rejects a negative timeout and
applies the default when the field is absent.
Output: Should be a unit test — This is isolated parsing and validation
logic that does not require a real component graph, process, or external
dependency.
Do not propose implementation changes unless the user asks for them.
Take datadog/e2e-audit from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.