Skip to content

More tests for Core#4396

Merged
HebaruSan merged 14 commits into
KSP-CKAN:masterfrom
HebaruSan:fix/more-tests
Jun 17, 2025
Merged

More tests for Core#4396
HebaruSan merged 14 commits into
KSP-CKAN:masterfrom
HebaruSan:fix/more-tests

Conversation

@HebaruSan
Copy link
Copy Markdown
Member

@HebaruSan HebaruSan commented Jun 17, 2025

Motivation

#4383 added coverage with Coveralls, and #4392 added some tests for Netkan. Core still has several files with 0% coverage.

Changes

Now we have tests for:

Side changes

  • ./build.sh test --where='namespace=Tests.Core' syntax now works with net8.0
  • While adding the test for CkanExporter, I noticed that the generated .ckan file had "kind": 1,, which should be a string according to the spec. Apparently 4a6df21 broke serialization of this property.
    Now it's fixed (and tested).
  • While adding the test for ModuleImporter, I noticed that it would only prompt to install if the identifier was already defined in the user's available modules and compatible. This doesn't make sense, since the goal of Use internal ckan and version file to install unrecognized ZIPs #4327 was to be able to install mods with no metadata in CKAN-meta.
    Now you're prompted to install anything with compatible ksp_version_* properties. Note that if it depends on something incompatible, you won't find out about that until the install starts.
  • Now GameInstanceManager.SteamLibrary is instantiated on-demand instead of unconditionally in the constructor, to improve performance in flows that don't need it (such as many tests).
  • NetkanTransformer.InjectVersionedOverrideTransformers is refactored to allow the deletion of VersionedOverrideTransformer.AddBefore and VersionedOverrideTransformer.AddAfter, with equal or better performance.

@HebaruSan HebaruSan added Bug Something is not working as intended Enhancement New features or functionality Core (ckan.dll) Issues affecting the core part of CKAN Tests Issues affecting the internal tests labels Jun 17, 2025
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 15714778159

Details

  • 12 of 42 (28.57%) changed or added relevant lines in 12 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.2%) to 28.326%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Core/GameInstanceManager.cs 0 1 0.0%
Netkan/Transformers/VersionedOverrideTransformer.cs 3 4 75.0%
Netkan/Transformers/NetkanTransformer.cs 0 7 0.0%
Core/Extensions/EnumerableExtensions.cs 0 21 0.0%
Files with Coverage Reduction New Missed Lines %
Netkan/Transformers/NetkanTransformer.cs 1 8.11%
Core/IO/SteamLibrary.cs 4 66.32%
Totals Coverage Status
Change from base Build 15655646813: 1.2%
Covered Lines: 8370
Relevant Lines: 31158

💛 - Coveralls

@HebaruSan HebaruSan merged commit 0c7c382 into KSP-CKAN:master Jun 17, 2025
6 checks passed
@HebaruSan HebaruSan deleted the fix/more-tests branch June 17, 2025 18:19
@HebaruSan HebaruSan mentioned this pull request Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality Tests Issues affecting the internal tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants