mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 15:34:06 +01:00
Sixth of the 16 untested fixes/lib libs, and the first with no dead branch to
fix -- the whole job was test-writing. 43 assertions across two files;
93/93 = 100.00% through run_all.sh, twice, the second at --min 100 (exit 0),
then cleared with the real gate confirming and no exemption.
The one genuine gap was check_memory_pressure's high-swap branch (lines
158-159), which fires only when swap is heavily used WHILE RAM is still
available -- a state this host does not happen to be in. The lib reads the
absolute /proc/meminfo, but every read goes through `awk`, so stubbing awk
supplies controlled figures without touching /proc: the stub answers on the
pattern being matched and execs the real awk for anything else. Both
directions are covered, including RAM genuinely exhausted, which must NOT be
flagged because it is not the stutter signature.
Everything else here is branch coverage of probes whose inputs are external
commands: failed systemd units, ACPI error counts, a CPU-hungry Xorg,
governors all-performance vs one-powersave vs unsupported, thermal
throttling excerpts, the TLP/power-profiles-daemon conflict in all three
combinations, and storage health with and without fstrim/smartctl.
lib_test_core.sh gains _t_stub_cat. "Print this fixture file" is by far the
commonest stub shape, and writing it inline forces every call site to embed
a literal ${LIB_TEST_DEV} that must not expand at write time -- SC2016 on
every use. Passing the fixture NAME as data removes the class outright, and
two earlier bluetooth test files are simplified onto it. All 21 test files
and three harnesses now lint clean with no suppression anywhere.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
18 lines
1.8 KiB
JSON
18 lines
1.8 KiB
JSON
{
|
|
"title": "Test arch_perf_probes.sh to 100% and clear it from the shell-coverage allowlist",
|
|
"objective": "Cover the sixth of the sixteen untested fixes/lib libs, the diagnostic-probe half of diagnose_arch_performance.sh. Unlike the two libs before it this one contains no dead branch, so the whole job is test-writing: reaching the swap-pressure branch that depends on /proc/meminfo, and the governor branches that depend on a real /sys tree.",
|
|
"acceptance_criteria": [
|
|
"arch_perf_probes.sh measures 100.00% (93/93) through lib/tests/run_all.sh, twice, the second run at --min 100 with exit 0.",
|
|
"check_shell_coverage.sh exits 0 for arch_perf_probes.sh with its allowlist line removed, i.e. with no exemption.",
|
|
"The check_memory_pressure swap branch is genuinely exercised with controlled figures, not skipped because this host happens to swap.",
|
|
"Every file in fixes/lib/tests stays under the repo's 250-line cap and passes shellcheck with no suppression added.",
|
|
"The five libs cleared earlier in the session still pass the gate."
|
|
],
|
|
"out_of_scope": [
|
|
"Any change to arch_perf_probes.sh itself.",
|
|
"bt_adapter.sh, still exempt at 98.55% for the backslash-continued assignment flavour of defect (a).",
|
|
"The remaining ten untested fixes/lib libs."
|
|
],
|
|
"verifier": "bash linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh (expects all 21 files passing, 16 + 27 for the two arch_perf_probes files), plus bash meta/scripts/shell_coverage_jail.sh --subject linux_configuration/scripts/single_use/fixes/lib/tests/run_all.sh --measure arch_perf_probes.sh --min 100 --fail-on-case-error -- \"\" (expects 93/93 = 100.00% and exit 0), plus bash meta/scripts/check_shell_coverage.sh linux_configuration/scripts/single_use/fixes/lib/arch_perf_probes.sh (expects exit 0)."
|
|
}
|