Skip to content

Add tests to reach 100% Clover coverage; run coverage job on JDK 17#1047

Open
bdemers wants to merge 1 commit intomasterfrom
fix-code-coverage
Open

Add tests to reach 100% Clover coverage; run coverage job on JDK 17#1047
bdemers wants to merge 1 commit intomasterfrom
fix-code-coverage

Conversation

@bdemers
Copy link
Copy Markdown
Member

@bdemers bdemers commented Apr 30, 2026

Summary

  • Adds explicit unit tests covering branches in ProviderKey, ProviderPrivateKey, ProvidedPrivateKeyBuilder, KeysBridge, and JcaTemplate.JcaInstanceFactory that were only previously exercised by Pkcs11Test
  • Switches the CI code-coverage job from Zulu JDK 8 to Temurin JDK 17
  • Removes the sleep 90s workaround (no longer needed once coverage is stable)

Why new tests?

On macOS, Pkcs11Test fails with a CKR_OPERATION_NOT_INITIALIZED error due to a known SoftHSM2/SunPKCS11 ECDSA incompatibility. The branches covered by that test were therefore uncovered locally. The new unit tests cover the same branches directly, making coverage pass on all platforms regardless of PKCS11 availability.

Local verification

Platform JDK Pkcs11Test Coverage result
macOS (master, no new tests) Corretto 8 excluded FAIL 99.89%
macOS (this branch) Corretto 8 excluded PASS 100%
macOS (this branch) Temurin 17 excluded PASS 100%

Note: the last passing CI run on master (#18535374355) used Ubuntu + Zulu JDK 8, where Pkcs11Test runs successfully and covered those branches. This PR makes coverage robust to platform differences.

@bdemers bdemers force-pushed the fix-code-coverage branch 4 times, most recently from 3ad982e to 60ea033 Compare May 1, 2026 03:15
Cover previously-uncovered branches in ProviderKey, ProviderPrivateKey,
ProvidedPrivateKeyBuilder, KeysBridge, and JcaTemplate.JcaInstanceFactory.

On macOS these branches are only exercised by Pkcs11Test (which fails locally
due to a SoftHSM2/SunPKCS11 ECDSA incompatibility), so explicit unit tests
are added to cover them on all platforms.

Switch the CI code-coverage job from Zulu JDK 8 to Temurin JDK 17, and remove
the now-unnecessary 'sleep 90s' workaround.
@bdemers bdemers force-pushed the fix-code-coverage branch from 60ea033 to 6e677bf Compare May 1, 2026 03:24
Copy link
Copy Markdown
Contributor

@lhazlewood lhazlewood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🚀

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