Commit b271085
test: add JaCoCo coverage + 83% line gate, raise coverage to ~85%
The SDK had no coverage instrumentation. The existing SdkTest aborts at
@BeforeAll without a live Firefox, so almost no logic was measured (~33%
floor). This adds JaCoCo (prepare-agent + report + check) and a new
mock/HTTP-based PercyLogicTest (43 tests) that covers the SDK logic
without a browser, lifting non-driver line coverage to ~84.7% (the CI
browser run reaches ~87.8%).
Gate: jacoco:check bound to the test phase, LINE minimum 0.83 — the
honest floor for the unit-testable logic. The remaining uncovered lines
are live-WebDriver-only (the JS-execution/cookie body of snapshot(),
changeWindowDimensionAndWait CDP/resize, processFrame iframe recovery,
the responsive-capture sleep) and are exercised by SdkTest on the
browser CI (MOZ_HEADLESS=1 npx percy exec -- mvn test).
PercyLogicTest covers: createRegion variants, snapshot/screenshot
dispatch + guards, web DOM post + automate session metadata + region
element conversion, responsive width-config HTTP, readiness config +
waitForReady disabled paths, getSerializedDOM (cookies, cross-origin
iframe, readiness diagnostics), healthcheck branches, log, Environment,
setClientInfo, DriverMetadata + Cache.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 53a64df commit b271085
2 files changed
Lines changed: 1081 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
187 | 232 | | |
188 | 233 | | |
189 | 234 | | |
| |||
0 commit comments