Skip to content

docs: improve test suite documentation - #86

Merged
man4ish merged 1 commit into
mainfrom
docs/test-suite-docstrings
Sep 18, 2026
Merged

man4ish merged 1 commit into
mainfrom
docs/test-suite-docstrings

Conversation

@man4ish

@man4ish man4ish commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Documentation-only pass over the Control Center backend test suite, following the standard used in the completed Studio, API Gateway and Workbench campaigns.

  • All 86 test modules have module docstrings with the Developer: attribution block (86/86)
  • All 309 test classes are documented (309/309 under the broadest rule: any class with test_* methods, a TestCase base, or a Test* name; 225/225 by the strict Test* prefix)
  • All 1,707 test_* functions have assertion-specific docstrings (1,707/1,707, including 115/115 async)
  • Existing docstrings were preserved unless stale or overstated (see below)

Only docstrings changed: 86 files, all under backend/tests/, +4,003 / -47. No production code, config, compose, or dependency changes.

Verification

  • AST equivalence vs 0504838: executable AST differences = 0 across all 86 files
  • Comments: tokenized comment streams are identical before and after in every file
  • Syntax: 0 failures; git diff --check clean; no secret-like patterns in added lines
  • Tests (run with -o addopts="", i.e. without the coverage gate), baseline taken from a clean export of 0504838:
    • focused (5 files completed in this pass): 151 passed before, 151 after
    • full backend/tests: 1,744 passed + 51 subtests before, identical after
    • collection: identical, 1,744 node ids

Docstring corrections

  • TestGetIntegrations: replaced "its guarantee to never leak a secret value" with a bounded statement; the test only checks that secret values set in the environment do not appear in the response body
  • test_routes_infra.py: two tests (/license and /audit-trail) shared identical docstrings; each now names its route
  • Docstrings for tests that assert less than their names suggest describe what is actually checked (e.g. test_route_requires_manage_infra_permission only asserts that a require_permission dependency exists, and test_empty_string_returns_zero feeds "0B")

Notes for review

  • Reformatted one-liners: 29 one-line def test_x(self): ... methods in test_main.py were split across lines to hold a docstring. AST-identical, but the diff there is not purely additive (the only non-docstring line changes in the PR).
  • Repeated docstrings: about 67 groups of identical test docstrings remain across the test_routes_*_proxy.py files (e.g. "A 403 from the upstream auth-service is relayed as a 403." on 25 tests). Each sits in a class whose docstring names the exact route, so they are left as is. Happy to make every docstring self-contained in a follow-up if preferred.
  • "certified" wording: three docstrings mention certified/CERTIFIED; that is the value of a certification_status field the tests assert on, not a compliance claim.
  • The repo's own pytest config enforces --cov-fail-under=98; I did not run the suite with coverage, so that gate is not covered by the numbers above.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@man4ish
man4ish merged commit 530cf57 into main Sep 18, 2026
2 checks passed
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