Skip to content

Enhance test coverage and update dependencies for development#258

Merged
mercyblitz merged 27 commits intomainfrom
dev
Mar 19, 2026
Merged

Enhance test coverage and update dependencies for development#258
mercyblitz merged 27 commits intomainfrom
dev

Conversation

@mercyblitz
Copy link
Contributor

This pull request introduces significant improvements to CI workflows and enhances unit test coverage across the codebase. The main changes include automating branch merges from main to dev and release, expanding and strengthening test cases for collections and converters, enforcing versioning standards in the Maven publishing workflow, and adding a new release automation step. There are also minor improvements to builder defaults and test coverage for classloading utilities.

CI/CD Workflow Enhancements:

  • Added a new GitHub Actions workflow (merge-main-to-branches.yml) that automatically merges the main branch into dev and release branches on every push to main, reducing manual maintenance and ensuring branch consistency.
  • Improved the Maven publishing workflow (maven-publish.yml) by:
    • Enforcing a strict semantic versioning format for the revision input and validating it before proceeding. [1] [2]
    • Adding a new release job that creates a git tag and GitHub release, bumps the patch version in pom.xml, and pushes the updated version for continued development.

Test Coverage Improvements:

  • Greatly expanded unit tests for collection utilities:
    • AbstractDequeTest: Added tests for getFirst, getLast, removeLastOccurrence, descendingIterator, size checks, and more, improving coverage and robustness. [1] [2] [3] [4]
    • ListsTest, SetsTest, MapsTest: Added immutability tests to ensure returned collections are unmodifiable. [1] [2] [3] [4] [5] [6]
  • Added a new test class for StringToByteConverter, including negative test cases for conversion failures.
  • Improved converter and classloading tests:
    • Added hash code and priority tests to AbstractConverterTest. [1] [2]
    • Added tests for ArtifactDetector with and without JDK libraries.
    • Added a test for setPriority in AbstractURLClassPathHandleTest.

Other Improvements:

  • Set a default value for the level field in the Deprecation.Builder class, improving builder usability.

These changes collectively improve the reliability, maintainability, and automation of the project.

References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]

mercyblitz and others added 25 commits March 5, 2026 10:28
Bump org.mockito:mockito-core from 5.14.2 to 5.22.0
Update the Maven <revision> property in pom.xml from 0.1.8-SNAPSHOT to 0.1.9-SNAPSHOT to prepare the next development iteration.
…yFilter

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…rage

Add missing test cases for StringToByteConverter and ClassFileJarEntryFilter
Add missing test cases for StringToByteConverter and ClassFileJarEntryFilter
Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…est-cases

[WIP] Enhance code coverage for existing test cases
Enhance the code coverage of testing
Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…erage

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…tdeque

Add test cases for ClassPathResourceConfigurationPropertyLoader to reach 100% coverage
Enhance tests for AbstractDeque and ClassPathResource for full coverage
…nsionFilter

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…dFileWatchService, and ArtifactDetector

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…ue, StringToIterableConverter, and AbstractURLClassPathHandle

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…ionUtils

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…ses-for-coverage

Add tests for ThrowableFunction and FileExtensionFilter to approach 100% coverage
Update the maven-publish workflow to require a strict major.minor.patch revision input (updated description/default) and validate its format. Add a release job that tags the repo, creates a GitHub release (using gh), increments the patch to a next SNAPSHOT in pom.xml, and commits the bumped version. Add a new workflow (merge-main-to-branches.yml) that automatically merges main into dev and release on pushes to main, handling missing branches and merge conflicts with fail/notify behavior.
Update the project parent version from 0.2.3 to 0.2.5 to pick up updates in the microsphere-build parent POM (build/config fixes or improvements). No other source changes were made.
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 98.14815% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../src/main/java/io/microsphere/collection/Sets.java 94.44% 2 Missing ⚠️
Files with missing lines Coverage Δ Complexity Δ
...src/main/java/io/microsphere/collection/Lists.java 97.67% <100.00%> (+40.91%) 38.00 <35.00> (+24.00)
.../src/main/java/io/microsphere/collection/Maps.java 97.67% <100.00%> (+43.62%) 38.00 <35.00> (+24.00)
...src/main/java/io/microsphere/lang/Deprecation.java 100.00% <ø> (ø) 23.00 <0.00> (ø)
.../src/main/java/io/microsphere/collection/Sets.java 94.18% <94.44%> (+46.88%) 37.00 <35.00> (+24.00)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI and others added 2 commits March 19, 2026 12:44
…anch coverage

Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com>
…e-coverage-java-tests

Refactor Sets/Maps/Lists MethodHandle dispatch for full branch coverage on any JDK
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@mercyblitz mercyblitz merged commit bb46223 into main Mar 19, 2026
11 of 12 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.

2 participants