test: raise coverage on under-tested modules#19
Merged
Merged
Conversation
Add 25 tests for src/migrations/migrate.py, previously untested despite running at every startup and transforming users' config and log files. All migrations are driven through the public migrate() entry point, so the orchestration logic (registry, dependency ordering, migrations.txt state, new-installation detection) is covered alongside each of the 7 migrations. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
src/main.py is pure application wiring — it parses args, instantiates every service and starts the Tornado server. It can't be unit-tested without a full integration environment, so its uncovered lines only distorted the metric. Excluding it makes the reported coverage reflect testable code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add 49 tests for the pure helpers and simple DOM utilities in common/utils/common.js: emptiness checks, array/object helpers, stringComparator, websocket-state checks, url/query helpers, id generators, isFullRegexMatch, DOM traversal helpers and HttpRequestError. Remaining gaps are browser-API-heavy functions (XHR, layout scrolling, clipboard, canvas text measurement) that aren't meaningfully testable in jsdom. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add 43 tests for src/utils/file_utils.py: read/write round-trips (bytes, newlines, encoding fallback), folder/existence helpers, path helpers (normalize_path, relative_path, split_all, is_root), create_unique_filename, make_executable, is_binary detection, broken-symlink detection, modification/deletion dates, search_glob, and the FileMatcher / SingleFileMatcher pattern logic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add 19 tests for SchedulePanel: scheduleType / weekdaysError computeds, buildScheduleSetup (one-time, max_executions and end_datetime end options, active weekday filtering, repeat unit/period), error tracking via onFieldError/checkErrors, and the schedule/close actions (store action stubbed). Uses shallowMount to isolate the component's logic from the child input components' v-model side effects. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…er.js (0%→40%) parameterHistory.js: 25 tests covering save/load (dedup, prepend, 10-entry cap, corrupted storage, backward-compat favorite flag), getMostRecentValues, remove/toggle (index guards, favorite protection, reordering) and the shouldUseHistoricalValues flag, plus graceful handling of throwing storage. An in-memory localStorage mock is used since jsdom doesn't expose one here. favicon_manager.js: 5 tests for defaultFavicon, setFavicon append/replace and the default fallback of the executing/finished setters. Canvas-rendered icons (onload path) aren't testable under jsdom and are left uncovered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds unit tests for several previously under-tested modules and removes one untestable file from the coverage denominator. No production code changes — tests and one
.coveragerctweak only.src/migrations/migrate.pysrc/main.pyweb-src/.../common/utils/common.jssrc/utils/file_utils.pyweb-src/.../schedule/SchedulePanel.vueweb-src/.../common/utils/parameterHistory.jsweb-src/.../main-app/components/favicon_manager.jsNotes
migrate.pyis driven through the publicmigrate()entry point, so the orchestration (registry, dependency ordering,migrations.txtstate, new-installation detection) is covered alongside each of the 7 migrations. This code runs at every startup and rewrites users' config/log files, so it's the highest-value gap closed.main.pyis pure application wiring (instantiates services, starts Tornado); excluded via.coveragercrather than tested, so the metric reflects testable code.SchedulePanel.vueusesshallowMountto isolate the component logic from child input components'v-modelside effects (a fullmountmaderepeatPeriod-related assertions flaky).parameterHistory.jsuses an in-memorylocalStoragemock since jsdom doesn't expose one in this setup.favicon_manager.jscaps at 40%: the canvas-rendered icons (Imageonloadpath) aren't executable under jsdom.Verification
🤖 Generated with Claude Code