Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing s3mock #266

Merged
merged 1 commit into from
Mar 28, 2022
Merged

Removing s3mock #266

merged 1 commit into from
Mar 28, 2022

Conversation

jglick
Copy link
Member

@jglick jglick commented Mar 14, 2022

#265 failed with internal dependency issues in S3Mock. Rather than work to maintain this dep, just removing it. Was only used in one test introduced in #62. As it turns out, #109 added another test of the same functionality

@Test
public void canCreateBucket() throws Throwable {
rr.then(new WithMinioServiceEndpoint(MinioIntegrationTest::_canCreateBucket));
}
private static void _canCreateBucket(JenkinsRule r) throws Throwable {
String testBucketName = "jenkins-ci-data";
Bucket createdBucket = config.createS3Bucket(testBucketName);
assertEquals(testBucketName, createdBucket.getName());
client.headBucket(new HeadBucketRequest(testBucketName));
}
which at least runs against an actual S3-compatible server with authentication and so is more convincing. Other interesting stuff to test would be disableSessionToken, use of acceleration, etc., which would require
@BeforeClass
public static void live() {
assumeThat("define $S3_BUCKET as explained in README", S3_BUCKET, notNullValue());
assumeThat("define $S3_DIR as explained in README", S3_DIR, notNullValue());
try {
AmazonS3ClientBuilder builder = AmazonS3ClientBuilder.standard();
assumeTrue(S3_BUCKET + " bucket does not exist", builder.build().doesBucketExistV2(S3_BUCKET));
assumeThat("can get credentials from environment", builder.getCredentials().getCredentials(), notNullValue());
} catch (SdkClientException x) {
x.printStackTrace();
assumeNoException("failed to connect to S3 with current credentials", x);
}
}

@jglick jglick added the tests label Mar 14, 2022
@jglick jglick requested a review from Vlatombe March 14, 2022 13:01
@jglick jglick requested a review from kuisathaverat March 28, 2022 14:01
@jglick jglick merged commit 6b40994 into jenkinsci:master Mar 28, 2022
@jglick jglick deleted the s3mock branch March 28, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants