Skip to content

Add support for preserving test history and testplan#46

Merged
mballance merged 2 commits intomasterfrom
mballance/testhist
Mar 7, 2026
Merged

Add support for preserving test history and testplan#46
mballance merged 2 commits intomasterfrom
mballance/testhist

Conversation

@mballance
Copy link
Copy Markdown
Member

No description provided.

mballance and others added 2 commits March 6, 2026 22:59
…ation

Phase 1 — Binary test history store (NcdbUCIS v2):
- history_buckets.py: per-test run records with seed, status, CPU time
- test_stats.py: aggregate flake_score, fail_rate, mean_cpu_time
- bucket_index.py: O(log n) bucket lookup for history queries
- contrib_index.py: unique-bin contribution tracking
- squash_log.py: compaction log for history buckets
- test_registry.py: test-name to integer-ID registry
- ncdb_ucis.py: NcdbUCIS.write_history(), query_test_history(), get_test_stats()
- ncdb_reader/writer/merger: v2 schema read/write/merge support
- constants.py: HIST_STATUS_OK/FAIL and v2 schema constants

Phase 2 — Testplan embedding and closure analysis:
- testplan.py: Testplan/Testpoint dataclasses with HJSon support
- testplan_hjson.py: parse_testplan_hjson() parser
- testplan_closure.py: compute_closure(), stage gate logic, TPStatus enum
- waivers.py: WaiverSet for scoped testpoint waivers
- ncdb_ucis.py: embed_testplan(), get_testplan(), get_testplan_closure()

Phase 3 — Reports, CI/CD exports, CLI subcommands, TUI:
- reports.py: 11 typed report functions (P0/P1/P2) with to_json() + format_*()
  A: report_testpoint_closure     E: report_stage_progression
  B: report_stage_gate            F: report_testpoint_reliability
  C: report_coverage_per_testpoint G: report_unexercised_covergroups
  D: report_regression_delta      I: report_coverage_contribution
  H: report_test_budget           L: report_safety_matrix
  M: report_seed_reliability
- testplan_export.py: export_junit_xml(), export_github_annotations(),
  export_summary_markdown() for CI/CD pipeline integration
- cmd/cmd_history.py: 'pyucis history query/stats' CLI subcommands
- cmd/cmd_testplan.py: 'pyucis testplan import/closure/export-junit' subcommands
- tui/views/testplan_view.py: view '8' — scrollable testplan closure table
- tui/views/test_history_view.py: v2 stats (flake_score, runs, CPU) in detail panel
- tui/models/coverage_model.py: get_testplan_closure(), get_v2_test_stats()
- help_overlay.py, keybindings.py, controller.py: register testplan view '8'
- report/coverage_metrics.py: CoverageMetrics dataclass for TUI model parity

Tests (1605 passing):
- tests/unit/ncdb/test_reports.py: 61 unit tests (P0/P1/P2 reports)
- tests/unit/ncdb/test_testplan_export.py: 27 unit tests (JUnit/GH/markdown)
- tests/unit/ncdb/test_testplan.py, test_testplan_closure.py, test_waivers.py,
  test_testplan_hjson.py, test_history_buckets.py, test_test_stats.py,
  test_bucket_index.py, test_contrib_index.py, test_squash_log.py,
  test_test_registry.py: full unit coverage of new modules
- tests/integration/test_ci_export.py: 15 integration tests
- tests/integration/test_history_workflow.py, test_testplan_workflow.py
- tests/test_tui_model_fidelity.py, test_tui_report_parity.py,
  tests/test_tui_view_data.py: TUI model and view data parity tests

Documentation:
- doc/source/working-with-coverage/test-history.rst
- doc/source/working-with-coverage/testplan.rst
- doc/source/working-with-coverage/reports.rst
- doc/source/reference/formats/ncdb-format.rst
- doc/source/reference/cli.rst, working-with-coverage/index.rst: updated
- README.md: v2 feature table, CLI examples, testplan workflow

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- reports.rst: add usage examples and autofunction/autoclass entries for
  report_test_budget (H), report_safety_matrix (L), report_seed_reliability (M)
- exploring-tui.rst: document views 6 (Code Coverage), 7 (Test History with
  v2 flake stats), and 8 (Testplan closure); update global key table 1-8

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mballance mballance merged commit a47708a into master Mar 7, 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