Skip to content

fix: .gitignore the real test-log path (changedetectionio/tests/logs)#4247

Open
AmirF194 wants to merge 1 commit into
dgtlmoon:masterfrom
AmirF194:fix/gitignore-test-logs-path
Open

fix: .gitignore the real test-log path (changedetectionio/tests/logs)#4247
AmirF194 wants to merge 1 commit into
dgtlmoon:masterfrom
AmirF194:fix/gitignore-test-logs-path

Conversation

@AmirF194

@AmirF194 AmirF194 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Running the test suite locally leaves ~200 untracked *_master.log files in the working tree — git status reports the whole changedetectionio/tests/logs/ directory as untracked after any local pytest run.

changedetectionio/tests/conftest.py writes a per-test loguru log to:

log_dir = os.path.join(os.path.dirname(__file__), "logs")   # -> changedetectionio/tests/logs/

.gitignore already intends to ignore these (tests/logs/), but because that pattern contains a slash, git anchors it to the repo root. There is no repo-root tests/, so the rule matches nothing:

$ git check-ignore -v changedetectionio/tests/logs/test_bad_access_master.log
(no match)

Fix

Point the pattern at the path the harness actually writes to, changedetectionio/tests/logs/, and add a comment noting where it comes from. .gitignore-only; no code/behavior change.

Verification

$ git check-ignore -v changedetectionio/tests/logs/test_probe_master.log
.gitignore:34:changedetectionio/tests/logs/   changedetectionio/tests/logs/test_probe_master.log

The directory is now correctly ignored, and a fresh test run no longer dirties the working tree.

The test harness (changedetectionio/tests/conftest.py) writes per-test
loguru logs to $(dirname __file__)/logs = changedetectionio/tests/logs/.
.gitignore only had 'tests/logs/', which git anchors to the repo root;
there is no repo-root tests/, so the rule matched nothing and every local
test run left ~200 untracked *_master.log files in the working tree.
Point the pattern at the real path so the logs are ignored as intended.
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