Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Add tests for uncovered KSA code paths - #51

Merged
Maximilian-Nesslauer merged 1 commit into
KSAModding:masterfrom
Maximilian-Nesslauer:ksa-coverage-tests
Jul 6, 2026
Merged

Maximilian-Nesslauer merged 1 commit into
KSAModding:masterfrom
Maximilian-Nesslauer:ksa-coverage-tests

Conversation

@Maximilian-Nesslauer

Copy link
Copy Markdown
Member

What

Raises patch coverage for the upstream PR (KSP-CKAN#4688, coveralls reported 78.53%). Almost entirely test code, targeting the uncovered changed lines from the coverage report: the KSA game class surface, DefaultCommandLines, the StarMap launch fallback when the config cannot be written, the TOML escape branches, the manifest sync, version detection fallbacks, transformer enumeration, cancelling the game selection on instance add, relative directories in AddParentDirectories, and the GUI icon accessor.

One production change: ProcessLoadedModsBeforeGameStart is split into a testable internal overload taking the manifest paths (the same pattern the file already uses for AdjustCommandLine and UpdateManifestFile). The public wrapper binds the real user-profile paths and is [ExcludeFromCodeCoverage], since tests must not write the user's real manifest.toml.

Deliberately still uncovered: MacPath and the Mac launch line (platform-gated, no Mac test runner in CI), RefreshVersions (live network download, same as KSP2's), and the KSA.dll FileVersionInfo catch (not deterministically triggerable).

Verification

All affected fixtures green locally on net481 and net10.0-windows (131 tests each).

- Cover the uncovered changed lines from the upstream PR's coverage report: game class surface and URLs, DefaultCommandLines, the StarMap launch fallback when the config cannot be written, the TOML escape branches, manifest sync via ProcessLoadedModsBeforeGameStart, version provider fallbacks, full transformer enumeration, cancelling the game selection on instance add, relative directories in AddParentDirectories, KSP2's FormatVersion, and the KSA GUI icon accessor.
- Split ProcessLoadedModsBeforeGameStart into a testable internal overload taking the manifest paths; the public wrapper binds the real user-profile paths and is excluded from coverage, since tests must not write the user's real manifest.toml.
- Deliberately still uncovered: MacPath and the Mac launch line (platform-gated), RefreshVersions (live network download), and the KSA.dll FileVersionInfo catch (not deterministically triggerable).
@Maximilian-Nesslauer Maximilian-Nesslauer added enhancement New feature or request client labels Jul 6, 2026
@github-project-automation github-project-automation Bot moved this to Todo in CKAN-KSA Jul 6, 2026
@Maximilian-Nesslauer Maximilian-Nesslauer moved this from Todo to In Progress in CKAN-KSA Jul 6, 2026
@Maximilian-Nesslauer
Maximilian-Nesslauer merged commit 9e454cd into KSAModding:master Jul 6, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in CKAN-KSA Jul 6, 2026
@Maximilian-Nesslauer
Maximilian-Nesslauer deleted the ksa-coverage-tests branch July 6, 2026 21:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

client enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant