Skip to content

test: add Kover aggregation - #575

Merged
kdroidFilter merged 7 commits into
nucleus-2.5from
feat/kover-75-coverage
Aug 19, 2026
Merged

test: add Kover aggregation#575
kdroidFilter merged 7 commits into
nucleus-2.5from
feat/kover-75-coverage

Conversation

@kdroidFilter

@kdroidFilter kdroidFilter commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

🚀 Description

Wires kotlinx-kover 0.9.8 onto every published library module and adds a large set of tests that drive shipped parsers, fallbacks, and macOS APIs. The aggregated report excludes only generated icon/symbol catalogues (sf-symbols, freedesktop.icons, window.icons). Production packages are not filtered to inflate the number.

On this Mac the published-runtime line coverage is 44.93% (10 873 / 24 198). The 75% koverVerify floor is kept on purpose and will fail check until Linux and Windows native paths are exercised.

📄 Motivation and Context

The published JAR is one coverage denominator across three OS backends. Most of the remaining miss is Tao scene/popup/deco and off-OS JNI, which cannot run here. This PR records the Kover setup and the Mac-reachable / pure-Kotlin work so Linux and Windows can continue on the same branch.

Bugs found while writing tests (fixed in this PR):

  • Version.fromString — empty semver groups used toInt() and threw; they now parse as 0 via toIntOrNull() ?: 0.
  • FileSelector — the exe format had a suffix mapping (-nsis.) but no .exe extension fallback, so a plain setup.exe was never selected.
  • LinuxSystemInfo / WindowsSystemInfoNativeLibraryLoader caches by library name (nucleus_system_info), so bridge.isLoaded can be true off-platform. ready() now also requires the matching Platform.Current.

🧪 How Has This Been Tested?

From /Users/elie/IdeaProjects/Nucleus-kover-coverage on macOS:

./gradlew :decorated-window-core:test :decorated-window-material3:test \
  :nucleus-application:test :scheduler:test :updater-runtime:test \
  :spellcheck:test :notification-macos:test :darkmode-detector:test \
  :system-color:test :autolaunch:test :core-runtime:test \
  :energy-manager:test :taskbar-progress:test :global-hotkey:test \
  :menu-macos:test :launcher-macos:test :service-management-macos:test \
  --no-configuration-cache
# BUILD SUCCESSFUL

./gradlew :koverXmlReport :koverLog --no-configuration-cache
# application line coverage: 44.9335%

taoHeadfulTest is optional: the Kover agent is attached via an args file, and Robot() cases skip when Accessibility TCC is missing (a hang until the 240s watchdog is treated as a defect).

📦 Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Enable kotlinx-kover 0.9.8 on library modules with a 75% line-coverage
floor. Generated icon/symbol catalogues stay excluded; production
packages are not filtered to inflate the number.

Also fix three bugs found while writing tests:
- Version.fromString treats empty semver groups as 0
- FileSelector maps the exe format to .exe
- system-info Linux/Windows backends require the matching Platform
@kdroidFilter
kdroidFilter force-pushed the feat/kover-75-coverage branch from c283630 to 0fdd1ec Compare August 18, 2026 10:29
Make the 75% floor the union of Linux, macOS and Windows reports
instead of a single-OS check. Exercise systemd, D-Bus, hidpi and
Linux JNI paths, and fix disableEfficiencyMode EACCES plus a
Windows getAllTasks UnsatisfiedLinkError off-host.
JNI libraries share a name across platforms, so isLoaded is not a
platform check. Gate Linux-only native calls, skip headless AWT and
off-OS launchd, and accept notification/hotkey failure when the
desktop service is missing.
Add portable unit tests for chrome helpers and Compose measure
policies, plus real-window cases for TitleBar, WindowScaffold,
WindowControls, and DialogTitleBar. Those run under Xvfb on the
existing tao-headful job.
NativeContextMenuRepresentation uses NSMenu on macOS, so the Compose
semantics assertion only applies off-Mac. Resolve Kover agent paths as
RegularFileProperty so taoHeadfulTest no longer captures the Gradle
script layout object.
@kdroidFilter
kdroidFilter marked this pull request as ready for review August 18, 2026 14:15
@kdroidFilter kdroidFilter changed the title test: add Kover aggregation and published-runtime coverage tests test: add Kover aggregation Aug 19, 2026
@kdroidFilter
kdroidFilter merged commit 95052ac into nucleus-2.5 Aug 19, 2026
22 of 23 checks passed
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