Commit c4dc70a
authored
test(storage): exclude jqwik tests on Java 8 (#13846)
### Problem
Jqwik version 1.9+ requires JDK 11+ at runtime. Since
`google-cloud-java` runs tests on JDK 8 matrix environments, Jqwik's
reflection-based class scanning fails when JSpecify 1.0.0 annotations
are present, causing `UnsupportedClassVersionError` or reflection
scanner crashes during JUnit test discovery on Java 8.
### Solution
This PR introduces a clean profile-based exclusion to isolate Jqwik on
Java 8 without impacting modern Java environments:
1. **Moved Jqwik dependency into `jqwik-tests` profile:** The
`net.jqwik:jqwik` library is no longer loaded globally; it is only added
to the test classpath on JDK 11+ (`[11,)`).
2. **Added `exclude-jqwik-on-java8` profile:** Active only when the JDK
is exactly `1.8`.
3. **Excluded Jqwik test compilation:** Inside the Java 8 profile, we
use `testExcludes` to skip compiling all Jqwik-based property tests
(e.g., `*PropertyTest.java`, `jqwik` packages, etc.) to prevent compile
errors when Jqwik is not on the classpath.
4. **Decoupled compilation dependencies:** Excluded
`RewindableByteBufferContentTest.java` on Java 8 as well, since it has
an import reference to a nested class inside
`RewindableContentPropertyTest.java` and would otherwise pull it into
compiler scope.
### Rationale
- Decouples Jqwik testing dependencies on Java 8 matrix builds,
preventing pipeline failures.
- Retains 100% test coverage for these property-based tests on modern
JDKs (11, 17, 21, etc.) since matrix builds continue to compile and run
them normally.1 parent 49be37a commit c4dc70a
1 file changed
Lines changed: 54 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | 341 | | |
348 | 342 | | |
349 | 343 | | |
| |||
474 | 468 | | |
475 | 469 | | |
476 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
477 | 525 | | |
478 | 526 | | |
479 | 527 | | |
| |||
0 commit comments