mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 21:27:02 +01:00
kcov works here once invoked correctly, so shell coverage is measurable after all. shell_coverage.sh wraps it as a gate; the XML parsing lives in shell_coverage_report.py per the rule against inlining another language's logic in a shell script. Two kcov traps are documented in the wrapper because both fail silently. It must be handed the test script DIRECTLY: given `bash script.sh` it instruments the bash binary, finds no shell source, and reports 0/0 at 0.00% -- indistinguishable from "nothing is covered". And per-line detail exists only in cov.xml; coverage.json carries the percentage alone, so it cannot say which lines are missing. First measurement put dns_iptables.sh at 68/74 = 91.89%, with all six uncovered lines in error and edge branches: chain creation failing, jump insertion failing, the stale-jump de-dupe log, and the v6 trusted-resolver ACCEPT. The stub grew failure injection and jump seeding to reach them, and four new cases take it to 74/74 = 100.00%. The gate fails closed: deleting the three ensure_chain failure cases drops it to 93.24%, names lines 23, 24, 37, 40, 41, and exits 1. Not wired into pre-commit -- kcov is absent on CI, and most shell files here have no test at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY |
||
|---|---|---|
| .. | ||
| fixtures | ||
| lib | ||
| run_all | ||
| _schema_validation.py | ||
| _session_autopsy_mutations.py | ||
| check_agent_contract.sh | ||
| check_ai_evidence.sh | ||
| check_append_only_sessions.sh | ||
| check_file_length.sh | ||
| check_no_binaries.sh | ||
| check_no_dufs_conf.sh | ||
| check_no_inline_python.sh | ||
| check_no_secrets.sh | ||
| check_polling_antipatterns.sh | ||
| check_python_location.sh | ||
| check_requirements_sync.py | ||
| ci_mirror.sh | ||
| disk_cleanup_check.sh | ||
| extract_shell_functions.py | ||
| init_agent_artifacts.sh | ||
| install_hooks.sh | ||
| makepkg-manual-dlagent.sh | ||
| mutate_session_autopsy_hooks.py | ||
| pytest_changed_packages.py | ||
| run_prettier_capped.sh | ||
| run_with_heavy_lock.sh | ||
| shell_coverage_report.py | ||
| shell_coverage.sh | ||
| trace_shell_split.sh | ||
| validate_contract.py | ||
| validate_evidence.py | ||
| verify_shell_split.sh | ||