Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 54 additions & 6 deletions java-storage/google-cloud-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,6 @@
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jqwik</groupId>
<artifactId>jqwik</artifactId>
<version>1.9.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
Expand Down Expand Up @@ -474,6 +468,60 @@
</build>

<profiles>
<profile>
<id>jqwik-tests</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>net.jqwik</groupId>
<artifactId>jqwik</artifactId>
<version>1.9.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<!--
Exclude Jqwik and its tests on Java 8 because Jqwik 1.9+ requires Java 11+.
Jqwik's reflection-based test scanning fails on Java 8 when JSpecify annotations are present.
Test coverage for these Jqwik property tests is still run and maintained on JDK 11+ matrix builds.
-->
<profile>
<id>exclude-jqwik-on-java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
Comment thread
nnicolee marked this conversation as resolved.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<configuration>
<testExcludes>
<exclude>**/*PropertyTest.java</exclude>
<exclude>**/JqwikTest.java</exclude>
<exclude>**/jqwik/**</exclude>
<exclude>**/StorageV2ProtoUtilsTest.java</exclude>
<exclude>**/JsonUtilsTest.java</exclude>
<exclude>**/ChunkSegmenterTest.java</exclude>
<exclude>**/DefaultBufferedWritableByteChannelTest.java</exclude>
<exclude>**/MinFlushBufferedWritableByteChannelTest.java</exclude>
<exclude>**/DefaultBufferedReadableByteChannelTest.java</exclude>
<exclude>**/Crc32cValueTest.java</exclude>
<exclude>**/ITSyncingFileChannelTest.java</exclude>
<exclude>**/RewindableByteBufferContentTest.java</exclude>
Comment on lines +508 to +516

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding individual test files in the POM's exclusion list is fragile and difficult to maintain. Additionally, if these files contain standard JUnit tests alongside jqwik property tests, excluding the entire file from compilation on Java 8 means we completely lose standard test coverage on Java 8.

Recommendation

  1. Separate Test Concerns: Move jqwik property tests into dedicated files ending with PropertyTest.java (e.g., JsonUtilsPropertyTest.java) or place them under a jqwik package.
  2. Retain Java 8 Coverage: Keep standard JUnit tests in their original files (e.g., JsonUtilsTest.java) without any jqwik imports so they can compile and run on Java 8.
  3. Simplify POM: This allows you to simplify the exclusions here to just the wildcard patterns (**/*PropertyTest.java and **/jqwik/**), removing the need to list individual files.

</testExcludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>idea-jqwik</id>
<dependencies>
Expand Down
Loading