mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 13:47:47 +01:00
github.com/kuhyx/system-maintenance, cloned to ~/system-maintenance First of the four live subsystems, and the one with no cross-unit source edges, so it establishes the pattern for the harder three. Passed in vmbox first -- the installer ran from an extracted-layout copy in the guest and detected its distro without any monorepo path -- then on the host. Its 21 Python and shell test files lived in linux_configuration/tests/, reaching bin/ through a shared conftest. Twenty moved with the code and got their own conftest; the shared one stays, since it serves several script directories that are not going anywhere. test_shutdown_timer_monitor.sh stays here. It is a pair test: it checks that digital_wellbeing's installer template and the monitor it installs still agree, so it belongs to whichever half owns the installer. It now reads the monitor from ~/system-maintenance and SKIPs when that checkout is absent. An intermediate version of that test fell back to /usr/local/bin, which HUNG -- the installed copy is stale and differs from source, so the test was comparing an installer template against a binary it never generated. Falling back to it would have been worse than skipping, so the fallback is gone and the comment says why. Also removed test_hosts_file_monitor.sh from shell-tests.yml's explicit list: it left with the subsystem, and CI would have failed on the missing file rather than quietly skipping it. Verified: 136 tests pass in the new repo, 202 still pass here, the pair test passes against the checkout and skips without it, and both the shell coverage gate and shellcheck are clean. Depth 294 -> 267. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
60 lines
4.1 KiB
JSON
60 lines
4.1 KiB
JSON
{
|
|
"intent": "Extract the periodic system-maintenance subsystem into its own public repo with the 21 test files that lived in linux_configuration/tests/, and keep the one cross-unit pair test working here.",
|
|
"scope": [
|
|
"linux_configuration/scripts/periodic_background/system-maintenance/ (32 files) -> github.com/kuhyx/system-maintenance, cloned to ~/system-maintenance",
|
|
"20 of its 21 test files in linux_configuration/tests/ moved with it",
|
|
"test_shutdown_timer_monitor.sh KEPT here: it is the pair test against digital_wellbeing's installer",
|
|
"conftest.py, meta/pyproject.toml, python-tests.yml, shell-tests.yml, shell-coverage-allowlist.txt cleaned",
|
|
"Non-goal: the other three subsystems"
|
|
],
|
|
"changes": [
|
|
"Extracted the subsystem and its tests in one filter-repo pass (28 commits), hoisting bin/, systemd/, logrotate/ to the repo root and linux_configuration/tests/ to tests/.",
|
|
"Gave the new repo its own tests/conftest.py putting bin/ on sys.path, plus a pyproject.toml with testpaths and branch coverage. The monorepo's shared conftest served several script directories and stays.",
|
|
"Fixed two extracted shell suites that hardcoded $REPO_DIR/scripts/periodic_background/system-maintenance/bin, now $REPO_DIR/bin.",
|
|
"Re-declared both CI halves in the new repo: python-tests.yml reached these modules through a paths filter and shell-tests.yml through a name list, neither of which follows the code out.",
|
|
"Repointed the kept pair test at ${SYSTEM_MAINTENANCE_DIR:-$HOME/system-maintenance}, skipping cleanly when absent.",
|
|
"Removed test_hosts_file_monitor.sh from shell-tests.yml's explicit list, since it left with the subsystem and CI would otherwise fail on a missing file."
|
|
],
|
|
"verification": [
|
|
{
|
|
"command": "sandbox: vm new sm1 + run the installer from an extracted-layout copy",
|
|
"result": "pass in vmbox, NOT host-verified",
|
|
"evidence": "install_usage_monitoring.sh detected the Arch distro family and resolved its 35 packages from a copy rooted outside the monorepo. A grep for testsAndMisc/periodic_background/linux_configuration across the extracted tree found only one stale comment, confirming no path coupling."
|
|
},
|
|
{
|
|
"command": "python -m pytest tests -q (extracted repo)",
|
|
"result": "pass",
|
|
"evidence": "136 passed."
|
|
},
|
|
{
|
|
"command": "bash tests/*.sh (extracted repo) + shellcheck",
|
|
"result": "pass",
|
|
"evidence": "Both remaining shell suites pass after the path fix; shellcheck exits 0 over every script with .shellcheckrc carried across."
|
|
},
|
|
{
|
|
"command": "pytest linux_configuration/tests (monorepo, after removal)",
|
|
"result": "pass",
|
|
"evidence": "202 passed."
|
|
},
|
|
{
|
|
"command": "bash linux_configuration/tests/test_shutdown_timer_monitor.sh",
|
|
"result": "pass",
|
|
"evidence": "Passes against the ~/system-maintenance checkout, matching the baseline worktree's behaviour. An intermediate version fell back to /usr/local/bin and HUNG: the installed copy is stale and differs from source, so the fallback was removed rather than kept. SYSTEM_MAINTENANCE_DIR=/nonexistent prints SKIP and exits 0."
|
|
},
|
|
{
|
|
"command": "bash meta/scripts/check_shell_coverage.sh --all",
|
|
"result": "pass",
|
|
"evidence": "Exit 0 with the five system-maintenance allowlist entries removed."
|
|
}
|
|
],
|
|
"risks": [
|
|
"/usr/local/bin/shutdown-timer-monitor.sh is stale relative to source. Left alone here; digital_wellbeing's installer owns reinstalling it, and that is the next extraction.",
|
|
"The pair test now depends on a sibling checkout at ~/system-maintenance. It skips rather than fails when absent, so CI without the checkout reports a skip, not a false pass on assertions it never ran.",
|
|
"/usr/local/bin/periodic-system-maintenance.sh still names digital_wellbeing and hosts paths inside this repo; those extractions must reinstall it."
|
|
],
|
|
"rollback": [
|
|
"git revert to restore the subsystem and its 21 tests, then re-add the conftest entry, pyproject sys.path element and both workflow references.",
|
|
"Re-run pytest linux_configuration/tests and check_shell_coverage.sh --all to confirm the restored state."
|
|
]
|
|
}
|