Skip to content

Commit bf52f26

Browse files
committed
s3 tests opt-in instead of opt-out
1 parent ed17059 commit bf52f26

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ jobs:
5959
MAVEN_OPTS: "-Xmx6g"
6060
run: |
6161
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
62-
mvn --no-transfer-progress test -DargLine="-Xmx6g"
62+
mvn --no-transfer-progress test -DargLine="-Xmx6g" -DrunS3Tests=true
6363
else
64-
# Skip S3 tests on Windows/macOS where the service isn't running (labeled with @Tag("s3"))
65-
mvn --no-transfer-progress test -DargLine="-Xmx6g" -DexcludedGroups="s3"
64+
mvn --no-transfer-progress test -DargLine="-Xmx6g"
6665
fi
6766
- name: Assemble JAR
6867
run: mvn package -DskipTests

src/test/java/dev/zarr/zarrjava/store/S3StoreTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import dev.zarr.zarrjava.ZarrException;
44
import org.junit.jupiter.api.Assertions;
55
import org.junit.jupiter.api.BeforeAll;
6-
import org.junit.jupiter.api.Tag;
76
import org.junit.jupiter.api.Test;
7+
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
88
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
99
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
1010
import software.amazon.awssdk.core.sync.RequestBody;
@@ -30,14 +30,15 @@
3030
* docker run -p 9090:9090 -p 9191:9191 -e "initialBuckets=zarr-test-bucket" adobe/s3mock:3.11.0
3131
* </pre>
3232
*/
33-
@Tag("s3")
33+
@EnabledIfSystemProperty(named = "runS3Tests", matches = "true")
3434
public class S3StoreTest extends WritableStoreTest {
3535

3636
String s3Endpoint = "http://localhost:9090";
3737
String bucketName = "zarr-test-bucket";
3838
S3Client s3Client;
3939
String testDataKey = "testData";
4040
S3Store s3Store;
41+
4142
@BeforeAll
4243
void setUpS3Client() throws ZarrException, IOException {
4344
s3Client = S3Client.builder()

src/test/java/dev/zarr/zarrjava/store/StoreTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ public void testGetWithStartEnd() {
9797
buffer.get(actualBytes, 0, 10);
9898
Assertions.assertArrayEquals(expectedBytes, actualBytes);
9999

100-
buffer = storeHandle.read(size-10);
100+
buffer = storeHandle.read(size - 10);
101101
Assertions.assertEquals(10, buffer.remaining());
102-
fullBuffer.position((int)(size-10));
102+
fullBuffer.position((int) (size - 10));
103103
fullBuffer.get(expectedBytes, 0, 10);
104104
buffer.get(actualBytes, 0, 10);
105105
Assertions.assertArrayEquals(expectedBytes, actualBytes);

0 commit comments

Comments
 (0)