Skip to content

docs: improve test suite documentation - #7

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

  • Adds a module docstring and Developer: Manish Kumar <manish@omnibioai.org> attribution to all 14 test modules under tests/.
  • Adds a docstring to all 107 test_* functions (98 were undocumented), each stating the specific behavior or security invariant the test asserts. Documents the fixtures. Existing docstrings are preserved verbatim.
  • Documentation only: no imports, assertions, fixtures, markers, parametrization, mocks or application code changed. +305/−1 lines; the 1 removed line is a module docstring rewritten only to add the attribution line.

Verification

  • AST equivalence: for every modified file, HEAD vs. working tree with docstring-only expression nodes stripped gives 0 executable differences (14 files).
  • Syntax: 0 failures across 14 files.
  • Focused tests (cache, security boundaries, tenancy, RBAC, engine permission/tenancy): 49 passed, 2 xfailed, identical before and after.
  • Full suite: 128 passed, 2 xfailed, identical before and after.
  • git diff --check is clean and only files under tests/ changed.

Notes for reviewers

  • Like omnibioai-hpc-policy-engine, this repo ships Cython-compiled .so files next to their .py sources; Redis is mocked throughout the test suite, so all runs used a network-blocking pytest plugin as an extra check — 0 blocked connection attempts.
  • Two tests remain xfail(strict=True) and are documented as such rather than as passing behavior: test_unknown_action_should_fail_closed and test_wildcard_action_should_not_bypass_authorization track known fail-open gaps in the production policy engine.
  • tests/test_role_hierarchy_fixtures.py maps a conceptual Platform Owner → Org Admin → Scientist → Viewer hierarchy onto this engine's real role/permission vocabulary; that framing is preserved in the docstrings since it's load-bearing context from the module's own docstring, not decoration.

🤖 Generated with Claude Code

Add module docstrings, per-test docstrings and developer attribution across
tests/, documenting the precise behavior or security invariant each test
exercises. Documentation only: no executable test semantics changed (verified
via AST comparison against the pre-change baseline for every modified file).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@man4ish
man4ish merged commit 7eb9608 into main Sep 18, 2026
1 of 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