Skip to content

Commit c260759

Browse files
authored
Merge pull request #57 from saalfeldlab/assume-minio
test: skip tests that assume a mock s3 (minio) server
2 parents 41717c3 + a61f40f commit c260759

4 files changed

Lines changed: 26 additions & 1 deletion

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>
115115

116116
<n5.version>4.0.1</n5.version>
117-
<n5-aws-s3.version>5.0.0</n5-aws-s3.version>
117+
<n5-aws-s3.version>5.0.1</n5-aws-s3.version>
118118
<n5-blosc.version>2.0.0</n5-blosc.version>
119119
<n5-google-cloud.version>6.0.0</n5-google-cloud.version>
120120
<n5-hdf5.version>3.0.0</n5-hdf5.version>

src/test/java/org/janelia/saalfeldlab/n5/universe/storage/n5/N5AmazonS3FactoryTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.janelia.saalfeldlab.n5.s3.N5AmazonS3Tests.tempBucketName;
2020
import static org.janelia.saalfeldlab.n5.s3.N5AmazonS3Tests.tempContainerPath;
2121
import static org.junit.Assert.assertTrue;
22+
import static org.junit.Assume.assumeTrue;
2223

2324
@Category({AmazonTest.class})
2425
public abstract class N5AmazonS3FactoryTest extends N5StorageTests.N5FactoryTest {
@@ -38,6 +39,14 @@ public abstract class N5AmazonS3FactoryTest extends N5StorageTests.N5FactoryTest
3839

3940
return AmazonS3KeyValueAccess.class;
4041
}
42+
43+
@BeforeClass
44+
public static void before() {
45+
46+
MockS3Factory.getOrCreateS3();
47+
assumeTrue("mock s3 server not running", MockS3Factory.isMinioServerRunning());
48+
}
49+
4150

4251
@AfterClass
4352
public static void removeTestBucket() {

src/test/java/org/janelia/saalfeldlab/n5/universe/storage/zarr/zarr2/Zarr2AmazonS3FactoryTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.janelia.saalfeldlab.n5.s3.N5AmazonS3Tests.tempBucketName;
2121
import static org.janelia.saalfeldlab.n5.s3.N5AmazonS3Tests.tempContainerPath;
2222
import static org.junit.Assert.assertTrue;
23+
import static org.junit.Assume.assumeTrue;
2324

2425
@Category({AmazonTest.class})
2526
public abstract class Zarr2AmazonS3FactoryTest extends ZarrStorageTests.Zarr2FactoryTest {
@@ -35,6 +36,13 @@ public abstract class Zarr2AmazonS3FactoryTest extends ZarrStorageTests.Zarr2Fac
3536
return s3 != null ? s3 : (s3 = super.createS3(uri));
3637
}
3738
};
39+
40+
@BeforeClass
41+
public static void before() {
42+
43+
MockS3Factory.getOrCreateS3();
44+
assumeTrue("mock s3 server not running", MockS3Factory.isMinioServerRunning());
45+
}
3846

3947
@Override public Class<?> getBackendTargetClass() {
4048

src/test/java/org/janelia/saalfeldlab/n5/universe/storage/zarr/zarr3/Zarr3AmazonS3FactoryTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.janelia.saalfeldlab.n5.s3.N5AmazonS3Tests.tempBucketName;
2121
import static org.janelia.saalfeldlab.n5.s3.N5AmazonS3Tests.tempContainerPath;
2222
import static org.junit.Assert.assertTrue;
23+
import static org.junit.Assume.assumeTrue;
2324

2425
@Category({AmazonTest.class})
2526
public abstract class Zarr3AmazonS3FactoryTest extends ZarrStorageTests.Zarr3FactoryTest {
@@ -35,6 +36,13 @@ public abstract class Zarr3AmazonS3FactoryTest extends ZarrStorageTests.Zarr3Fac
3536
return s3 != null ? s3 : (s3 = super.createS3(uri));
3637
}
3738
};
39+
40+
@BeforeClass
41+
public static void before() {
42+
43+
MockS3Factory.getOrCreateS3();
44+
assumeTrue("mock s3 server not running", MockS3Factory.isMinioServerRunning());
45+
}
3846

3947
@Override public Class<?> getBackendTargetClass() {
4048

0 commit comments

Comments
 (0)