build,test: modernize JS testing (pnpm + Web Test Runner) for faster, reproducible browser runs #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
This PR modernizes the JS test infrastructure for speed and reliability:
Refs:
Why Web Test Runner vs Karma (key advantages)
Why pnpm vs one‑off npx
pnpm-lock.yaml
setup-node
cache for pnpm storeChanges
What’s Included
Tasks
jsBrowserTest
: single WTR run over all split WebCrypto filesjsAllTest
: JS Node + browserjsBrowserTestCore
(KDF/digests),jsBrowserTestAes
,jsBrowserTestMac
,jsBrowserTestEc
,jsBrowserTestRsa
,jsBrowserTestCompat
Flags and defaults
-Pckbuild.wtrGrep="<regex>"
-Pckbuild.providerTests.step=
compatibility.generate
→CompatibilityTest.*generateStep$
compatibility.generateStress
→CompatibilityTest.*generateStressStep$
compatibility.validate
→CompatibilityTest.*validateStep$
-Pckbuild.wtrLogs=true
(local default on)-Pckbuild.wtrLive=true
(local default on)-Pckbuild.fast=true
(local default on)-Pckbuild.wtrConcurrency=4
(local default 4)-Pckbuild.wtrHeadful=true
,-Pckbuild.wtrDevtools=true
Default filtering:
providerTests.step
or grep.Fast mode tuning
TestTuning.fast
read by shared testswindow.__CK_FAST__
fromWTR_FAST
env (wired from Gradle property)-Dck.fast=true
(native stays off)DigestTest
: fewer log‑scale iterations, fewer chunked repeats, smaller large buffersHmacCompatibilityTest
: reduced max data sizeTest structure split (for parallelism)
CI changes
jsAllTest
for JS jobsproviderTests.step
filteringInfra & build
pnpm-lock.yaml
package.json
), removed Karma configUsage
./gradlew jsBrowserTest
./gradlew jsBrowserTestAes
./gradlew jsBrowserTestCompat -Pckbuild.providerTests.step=compatibility.generate
./gradlew jsBrowserTestCompat -Pckbuild.providerTests.step=compatibility.validate
./gradlew jsBrowserTest -Pckbuild.wtrGrep="WebCrypto_(EdDsaTest|XdhTest).*(testSignVerify|testDeriveSharedSecret)$"
./gradlew jsBrowserTest -Pckbuild.wtrHeadful=true -Pckbuild.wtrDevtools=true
Speed & iteration
Breaking/Notable changes
providerTests.step
or grep)Validation
./gradlew installBrowsers
./gradlew jsBrowserTest
./gradlew jsBrowserTestCompat -Pckbuild.providerTests.step=compatibility.generate
Notes
Follow‑ups (optional)