T5.3: Fill test gaps — cleanup, folder filtering, migration, concurrent RunDue

- src/runner/cleanup_test.go (new): 7 tests for CleanupLogs covering
  age-based deletion, count-based trimming (oldest removed, newest kept),
  non-.log files and subdirs are never touched, and zero-limit behaviour.
- src/ui/jobs_view_test.go (new): 6 tests for filteredJobIndexes,
  folderOptions, and filterValue — the folder filter logic is now verified
  without Fyne widget interaction.
- src/storage/store_test.go: two new tests — legacy pysentry.yaml migration
  and first-run default creation.
- src/app/operations_test.go: TestRunDueSkipsJobInRunningState confirms
  RunDue honours the LastState == "Running" guard and refuses a second
  concurrent run even when NextDue is in the past.
- docs/REFACTORING.md: mark T5.3 complete.
- docs/TESTS.md: retire the covered gaps; update package path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mixeme
2026-06-22 07:31:40 +03:00
parent 428f018fe1
commit d0cd82744d
6 changed files with 358 additions and 10 deletions
+1 -1
View File
@@ -279,7 +279,7 @@ Track progress here. Mark tasks complete as they land and pass review.
### Phase 5 — Hardening & docs
- [x] T5.1 — Surface errors from service + storage
- [x] T5.2 — Introduce `autostart.Manager` interface
- [ ] T5.3 — Fill test gaps (folder filtering, cleanup, migration, concurrency)
- [x] T5.3 — Fill test gaps (folder filtering, cleanup, migration, concurrency)
- [ ] T5.4 — Run `go test -race ./...` clean on both platforms
- [ ] T5.5 — Update docs (ARCHITECTURE.md, TESTS.md, README)
+4 -9
View File
@@ -1,6 +1,6 @@
# GoSentry Test Suite
All tests are located alongside source code in the `src/core/` package. Tests follow Go conventions with `*_test.go` filename patterns.
All tests are located alongside source code in their respective packages under `src/`. Tests follow Go conventions with `*_test.go` filename patterns.
## Running Tests
@@ -172,12 +172,7 @@ Tests Linux autostart entry creation via XDG Desktop Entry files.
---
## Future Test Coverage Gaps
## Remaining Test Coverage Gaps
Potential areas for additional tests:
- Job group/folder filtering and persistence
- Log cleanup (max file count and max age)
- Settings persistence and migration
- GUI integration tests (currently untested)
- Concurrent job execution
- Job history and run record storage
- GUI integration tests — Fyne widget interaction is not yet tested
- Job history and run record storage — on-disk run-record retrieval not covered