Skip to content

Commit

Permalink
Add Minio to CI
Browse files Browse the repository at this point in the history
Skip tests which fail with 2.6.0 but will succeed with 2.6.1.
  • Loading branch information
gaul committed Dec 23, 2024
1 parent de65b61 commit c84b06e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 6 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,22 @@ jobs:
run: |
# TODO: run other test classes
mvn test -Ds3proxy.test.conf=s3proxy-azurite.conf -Dtest=AwsSdkTest
kill $(pidof npx)
- name: Install Minio
run: |
curl -o minio https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
- name: Start Minio
run: |
mkdir mnt/
# TODO: kill this afterwards
MINIO_SERVER_URL=http://127.0.0.1:9000 MINIO_ROOT_USER=remote-identity MINIO_ROOT_PASSWORD=remote-credential ./minio server mnt/ &
- name: Maven Test with Minio
run: |
# TODO: run other test classes
mvn test -Ds3proxy.test.conf=s3proxy-minio.conf -Dtest=AwsSdkTest
kill $(pidof minio)
- name: Install s3-tests
run: |
Expand Down
34 changes: 28 additions & 6 deletions src/test/java/org/gaul/s3proxy/AwsSdkTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public final class AwsSdkTest {
.withMaxErrorRetry(0)
.withSignerOverride("S3SignerType");
private static final long MINIMUM_MULTIPART_SIZE = 5 * 1024 * 1024;
private static final int MINIO_PORT = 9000;

private URI s3Endpoint;
private EndpointConfiguration s3EndpointConfig;
Expand Down Expand Up @@ -605,6 +606,7 @@ public void testUpdateBlobXmlAcls() throws Exception {
// TODO:
assumeTrue(!blobStoreType.equals("transient-nio2"));
assumeTrue(!Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType));
assumeTrue(blobStoreEndpoint.getPort() != MINIO_PORT);

String blobName = "testUpdateBlobXmlAcls-blob";
var metadata = new ObjectMetadata();
Expand Down Expand Up @@ -650,6 +652,9 @@ public void testUnicodeObject() throws Exception {

@Test
public void testSpecialCharacters() throws Exception {
// TODO: fixed in jclouds 2.6.1
assumeTrue(blobStoreEndpoint.getPort() != MINIO_PORT);

String prefix = "special !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
if (blobStoreType.equals("azureblob") ||
blobStoreType.equals("azureblob-sdk") ||
Expand Down Expand Up @@ -815,6 +820,8 @@ public void testPartNumberMarker() throws Exception {

@Test
public void testHttpClient() throws Exception {
assumeTrue(blobStoreEndpoint.getPort() != MINIO_PORT);

String blobName = "blob-name";
var metadata = new ObjectMetadata();
metadata.setContentLength(BYTE_SOURCE.size());
Expand Down Expand Up @@ -1028,7 +1035,10 @@ public void testBlobListV2() throws Exception {
.withStartAfter("1"));
assertThat(result.getContinuationToken()).isEmpty();
assertThat(result.getStartAfter()).isEqualTo("1");
assertThat(result.getNextContinuationToken()).isEqualTo("2");
if (blobStoreEndpoint.getPort() != MINIO_PORT) {
// Minio returns "2[minio_cache:v2,return:]"
assertThat(result.getNextContinuationToken()).isEqualTo("2");
}
assertThat(result.isTruncated()).isTrue();
assertThat(result.getObjectSummaries()).hasSize(1);
assertThat(result.getObjectSummaries().get(0).getKey()).isEqualTo("2");
Expand All @@ -1038,9 +1048,12 @@ public void testBlobListV2() throws Exception {
.withBucketName(containerName)
.withMaxKeys(1)
.withContinuationToken(result.getNextContinuationToken()));
assertThat(result.getContinuationToken()).isEqualTo("2");
if (blobStoreEndpoint.getPort() != MINIO_PORT) {
// Minio returns "2[minio_cache:v2,return:]"
assertThat(result.getContinuationToken()).isEqualTo("2");
assertThat(result.getNextContinuationToken()).isEqualTo("3");
}
assertThat(result.getStartAfter()).isEmpty();
assertThat(result.getNextContinuationToken()).isEqualTo("3");
assertThat(result.isTruncated()).isTrue();
assertThat(result.getObjectSummaries()).hasSize(1);
assertThat(result.getObjectSummaries().get(0).getKey()).isEqualTo("3");
Expand All @@ -1050,10 +1063,15 @@ public void testBlobListV2() throws Exception {
.withBucketName(containerName)
.withMaxKeys(1)
.withContinuationToken(result.getNextContinuationToken()));
assertThat(result.getContinuationToken()).isEqualTo("3");
if (blobStoreEndpoint.getPort() != MINIO_PORT) {
// Minio returns "3[minio_cache:v2,return:]"
assertThat(result.getContinuationToken()).isEqualTo("3");
assertThat(result.getNextContinuationToken()).isNull();
}
assertThat(result.getStartAfter()).isEmpty();
assertThat(result.getNextContinuationToken()).isNull();
assertThat(result.isTruncated()).isFalse();
if (blobStoreEndpoint.getPort() != MINIO_PORT) {
assertThat(result.isTruncated()).isFalse();
}
assertThat(result.getObjectSummaries()).hasSize(1);
assertThat(result.getObjectSummaries().get(0).getKey()).isEqualTo("4");
}
Expand Down Expand Up @@ -1315,6 +1333,8 @@ public void testMaximumMultipartUpload() throws Exception {
public void testMultipartUploadAbort() throws Exception {
assumeTrue(!blobStoreType.equals("azureblob-sdk") &&
!blobStoreType.equals("google-cloud-storage"));
// TODO: fixed in jclouds 2.6.1
assumeTrue(blobStoreEndpoint.getPort() != MINIO_PORT);

String blobName = "multipart-upload-abort";
ByteSource byteSource = TestUtils.randomByteSource().slice(
Expand Down Expand Up @@ -1568,6 +1588,8 @@ public void testConditionalGet() throws Exception {

@Test
public void testStorageClass() throws Exception {
// Minio only supports STANDARD and REDUCED_REDUNDANCY
assumeTrue(blobStoreEndpoint.getPort() != MINIO_PORT);
String blobName = "test-storage-class";
var metadata = new ObjectMetadata();
metadata.setContentLength(BYTE_SOURCE.size());
Expand Down
14 changes: 14 additions & 0 deletions src/test/resources/s3proxy-minio.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
s3proxy.endpoint=http://127.0.0.1:0
s3proxy.secure-endpoint=https://127.0.0.1:0
#s3proxy.service-path=s3proxy
# authorization must be aws-v2, aws-v4, aws-v2-or-v4, or none
s3proxy.authorization=aws-v2-or-v4
s3proxy.identity=local-identity
s3proxy.credential=local-credential
s3proxy.keystore-path=keystore.jks
s3proxy.keystore-password=password

jclouds.provider=s3
jclouds.identity=remote-identity
jclouds.credential=remote-credential
jclouds.endpoint=http://127.0.0.1:9000

0 comments on commit c84b06e

Please sign in to comment.