Skip to content

docs(test): require production-reachable unit tests - #2221

Merged
thieman merged 1 commit into
mainfrom
thieman/test-quality-guidelines
Jul 28, 2026
Merged

docs(test): require production-reachable unit tests#2221
thieman merged 1 commit into
mainfrom
thieman/test-quality-guidelines

Conversation

@thieman

@thieman thieman commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Had the clanker try to self-remediate based on this discussion around some useless tests #2185 (comment)

Summary

  • Require unit tests to exercise a production behavior or branch.
  • Prohibit tests whose sole subject is a test-only helper.
  • Add a counterfactual self-review check based on mutating or removing the claimed production behavior.

Motivation

A review of test-only networking helpers in #2185 showed that realistic setup and strong-looking assertions can still provide no production coverage. These rules make production reachability and mutation sensitivity explicit review requirements.

Test plan

  • make check-docs
  • Repository pre-commit checks

Add explicit production reachability, test-helper scope, and counterfactual self-review requirements so realistic-looking test-only harnesses are not mistaken for behavioral coverage.
@dd-octo-sts dd-octo-sts Bot added the area/docs Reference documentation. label Jul 28, 2026
@pr-commenter

pr-commenter Bot commented Jul 28, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: f90357b · Comparison: 11a3ac3 · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 40.83 MiB (baseline) vs 40.83 MiB (comparison)
Size Change: -8 B (-0.00%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
anon.44a0faa3240fa409baa379409d152aec.1.llvm.12655547928165574868 -130 B 1
anon.44a0faa3240fa409baa379409d152aec.1.llvm.8379627709259428528 +129 B 1
anon.44a0faa3240fa409baa379409d152aec.4.llvm.12655547928165574868 -114 B 1
anon.44a0faa3240fa409baa379409d152aec.4.llvm.8379627709259428528 +113 B 1
anon.44a0faa3240fa409baa379409d152aec.3.llvm.12655547928165574868 -109 B 1
anon.44a0faa3240fa409baa379409d152aec.3.llvm.8379627709259428528 +108 B 1
anon.44a0faa3240fa409baa379409d152aec.0.llvm.12655547928165574868 -97 B 1
anon.44a0faa3240fa409baa379409d152aec.0.llvm.8379627709259428528 +96 B 1
anon.44a0faa3240fa409baa379409d152aec.2.llvm.12655547928165574868 -95 B 1
anon.44a0faa3240fa409baa379409d152aec.2.llvm.8379627709259428528 +94 B 1
[Unmapped] -3 B 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW]    +129  [NEW]     +40    anon.44a0faa3240fa409baa379409d152aec.1.llvm.8379627709259428528
  [NEW]    +113  [NEW]     +24    anon.44a0faa3240fa409baa379409d152aec.4.llvm.8379627709259428528
  [NEW]    +108  [NEW]     +19    anon.44a0faa3240fa409baa379409d152aec.3.llvm.8379627709259428528
  [NEW]     +96  [NEW]      +7    anon.44a0faa3240fa409baa379409d152aec.0.llvm.8379627709259428528
  [NEW]     +94  [NEW]      +5    anon.44a0faa3240fa409baa379409d152aec.2.llvm.8379627709259428528
  -5.0%      -3  [ = ]       0    [Unmapped]
  [DEL]     -95  [DEL]      -5    anon.44a0faa3240fa409baa379409d152aec.2.llvm.12655547928165574868
  [DEL]     -97  [DEL]      -7    anon.44a0faa3240fa409baa379409d152aec.0.llvm.12655547928165574868
  [DEL]    -109  [DEL]     -19    anon.44a0faa3240fa409baa379409d152aec.3.llvm.12655547928165574868
  [DEL]    -114  [DEL]     -24    anon.44a0faa3240fa409baa379409d152aec.4.llvm.12655547928165574868
  [DEL]    -130  [DEL]     -40    anon.44a0faa3240fa409baa379409d152aec.1.llvm.12655547928165574868
  -0.0%      -8  [ = ]       0    TOTAL

@thieman
thieman marked this pull request as ready for review July 28, 2026 17:29
@thieman
thieman requested a review from a team as a code owner July 28, 2026 17:29

@datadog-official datadog-official Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

More details

The PR adds documentation-only review guidance requiring tests to reach production behavior and survive a counterfactual mutation. The wording is consistent with the surrounding testing taxonomy and introduces no runtime behavior or clear diff-only hazard; documentation lint could not be completed because Vale is unavailable.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 11a3ac3 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@thieman
thieman merged commit 151ad17 into main Jul 28, 2026
56 of 61 checks passed
@thieman
thieman deleted the thieman/test-quality-guidelines branch July 28, 2026 17:32
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 28, 2026
Had the clanker try to self-remediate based on this discussion around
some useless tests
#2185 (comment)

## Summary

- Require unit tests to exercise a production behavior or branch.
- Prohibit tests whose sole subject is a test-only helper.
- Add a counterfactual self-review check based on mutating or removing
the claimed production behavior.

## Motivation

A review of test-only networking helpers in #2185 showed that realistic
setup and strong-looking assertions can still provide no production
coverage. These rules make production reachability and mutation
sensitivity explicit review requirements.

## Test plan

- `make check-docs`
- Repository pre-commit checks 151ad17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Reference documentation. mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants