Skip to content

test: add diagnostic redaction, path normalization, and artifact pairing tests#30

Open
dev-khimesh wants to merge 4 commits into
Peter7896:mainfrom
dev-khimesh:main
Open

test: add diagnostic redaction, path normalization, and artifact pairing tests#30
dev-khimesh wants to merge 4 commits into
Peter7896:mainfrom
dev-khimesh:main

Conversation

@dev-khimesh

Copy link
Copy Markdown

Summary

Add 15 deterministic regression tests for diagnostic redaction and artifact pairing.

Changes

  • Added tests/test_diagnostic_redaction.py with 15 tests covering:
    • Path normalization: diagnostic metadata paths are repo-relative with forward slashes
    • Redaction: header fields (generated_at, hostname, user, python, platform) do not leak repo paths
    • Redaction: /tmp, /var/tmp, repo checkouts, and hostnames not leaked in diagnostic snapshots
    • Artifact pairing: JSON .logd reference matches actual generated artifact
    • Missing artifact detection: diagnostic_logd_error populated when encryption fails
    • Chunked artifacts: all split parts are referenced in JSON metadata
    • Determinism: commit_id is 8-char hex, paths follow expected naming patterns
    • Report shape: correct JSON structure with pass/fail counts
  • All tests deterministic on Windows and Unix-like hosts (using Path, tempfile, forward-slash conventions)

Validation

python3 -m pytest tests/test_diagnostic_redaction.py -v  # 15/15 pass

Closes #1

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.

[$40 BOUNTY] [Python] Add diagnostic redaction regression tests

1 participant