fix(tests): check_docs and the CLI tests write data/hikcentral.db and logs/lifecycle.log into the checkout #210
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#210
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Agent Brief
Category: bug
Summary: The test suite and the docs check write files into the checkout they run in: an empty
data/hikcentral.dband alogs/lifecycle.logfull of fake test users. They must write only to temporary locations.Current behavior:
scripts/check_docs.pycreates an empty database.app.mainto read the OpenAPI routes. The import makes the door service load doors from the defaultDATABASE_PATH(data/hikcentral.db).Error loading doors from DB: no such table: door_records.logs/.cli_test_user,cli_prompt_userandcli_passwd_user, and calllog_lifecycle_event()withoutrepo_dirorlog_file_override../logs/lifecycle.logrelative to wherever pytest runs, so every pytest run, including the pre-commit hook, appends 4 entries.scripts/wt prune, whichwt mergeruns, rightly refuses to delete a worktree that holds ignored local files, since they could be real data. So every merged PR's worktree is kept and needs a manualwt rm -f.Desired behavior:
scripts/check_docs.pycreates and opens no database file in the checkout. Either pointDATABASE_PATHat a temporary location before importing the app, or build the OpenAPI schema without starting services that touch the DB. The "Error loading doors" line goes away.logs/ordata/. The CLI tests pass atmp_path-based location, as the other lifecycle-log tests already do.tests/conftest.py) that sends the default lifecycle log location to a temp dir during tests.pytestrun plusscripts/check_docs.py, neitherdata/norlogs/exists in a fresh worktree, or their contents are unchanged.Acceptance criteria:
data/orlogs/,python3 scripts/check_docs.pysucceeds, prints no DB error, and creates nodata/file.pytestrun creates nologs/lifecycle.logand nodata/file.logs/lifecycle.logunder the real install directory.scripts/wt merge/wt pruneremoves a merged PR's worktree without the "holds ignored local files" warning when nothing else was added locally.Out of scope:
wt prune's safety rule about ignored files. It is correct.Found while merging #169 (2026-10-02).
🤖 Generated with Claude Code
gabogg referenced this issue2026-10-02 18:23:43 +00:00
Tracked in draft PR #218 (fix/test-isolation), which closes this issue.
gabogg referenced this issue2026-10-03 09:49:55 +00:00