Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 7 additions & 5 deletions buildspecs/integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ phases:
commands:
- |
if [ ! -z "$INTEGRATION_TEST_ROLE_ARN" ]; then
ASSUME_ROLE_OUTPUT=`aws sts assume-role --role-arn "$INTEGRATION_TEST_ROLE_ARN" --role-session-name "integration-tests" --duration-seconds 7200 --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text`
AWS_ACCESS_KEY_ID=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $1 }'`
AWS_SECRET_ACCESS_KEY=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $2 }'`
AWS_SESSION_TOKEN=`echo $ASSUME_ROLE_OUTPUT | awk '{ print $3 }'`
echo "Using role $INTEGRATION_TEST_ROLE_ARN with access key $AWS_ACCESS_KEY_ID."
mkdir -p ~/.aws
cat > ~/.aws/config << EOF
[profile aws-test-account]
credential_source = EcsContainer
role_arn = $INTEGRATION_TEST_ROLE_ARN
EOF
echo "Created AWS config for assuming role $INTEGRATION_TEST_ROLE_ARN with auto-refresh."
fi
- mvn clean install -Dskip.unit.tests -P integration-tests -Dfindbugs.skip -Dcheckstyle.skip -T1C $MAVEN_OPTIONS
- JAVA_VERSION=$(java -version 2>&1 | grep -i version | cut -d'"' -f2 | cut -d'.' -f1-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static void tearDown() {
}

@Test
@org.junit.Ignore("DataPipeline is deprecated and not allowlisted in integ test account")
public void testPipelineOperations() throws InterruptedException {
// Create a pipeline.
CreatePipelineResponse createPipelineResult = dataPipeline.createPipeline(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -81,6 +82,7 @@ public static void teardown() {
}
}

@Disabled("S3 Select not supported for new accounts")
@ParameterizedTest(autoCloseArguments = false)
@MethodSource("s3AsyncClients")
public void selectObjectContent_onResponseInvokedWithResponse(S3AsyncClient client) {
Expand All @@ -90,6 +92,7 @@ public void selectObjectContent_onResponseInvokedWithResponse(S3AsyncClient clie
assertThat(handler.response).isNotNull();
}

@Disabled("S3 Select not supported for new accounts")
@ParameterizedTest(autoCloseArguments = false)
@MethodSource("s3AsyncClients")
public void selectObjectContent_recordsEventUnmarshalledCorrectly(S3AsyncClient client) {
Expand All @@ -104,6 +107,7 @@ public void selectObjectContent_recordsEventUnmarshalledCorrectly(S3AsyncClient
assertThat(recordsEvent.payload().asUtf8String()).contains("A\nC");
}

@Disabled("S3 Select not supported for new accounts")
@ParameterizedTest(autoCloseArguments = false)
@MethodSource("s3AsyncClients")
public void selectObjectContent_invalidQuery_unmarshallsErrorResponse(S3AsyncClient client) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static void clearClass() {
public void initialize() {
crossRegionS3Client = S3AsyncClient.builder()
.region(CROSS_REGION)
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.crossRegionAccessEnabled(true)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static void clearClass() {
public void initialize() {
crossRegionS3Client = S3AsyncClient.crtBuilder()
.region(Region.AWS_GLOBAL)
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.crossRegionAccessEnabled(true)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static void clearClass() {
public void initialize() {
crossRegionS3Client = S3Client.builder()
.region(Region.US_EAST_1)
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.crossRegionAccessEnabled(true)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public void s3Presigner_s3ExpressConfigurationUseS3Express_presignsS3ExpressRequ

S3Presigner presigner = S3Presigner.builder()
.region(TEST_REGION)
.s3Client(s3)
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.build();

GetObjectRequest getObjectRequest = GetObjectRequest.builder().bucket(testBucket).key(KEY).build();
Expand All @@ -319,7 +319,7 @@ public void s3Presigner_s3ExpressConfigurationS3ClientConfigured_presignsS3Expre

S3Presigner presigner = S3Presigner.builder()
.region(TEST_REGION)
.s3Client(s3)
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.build();

GetObjectRequest getObjectRequest = GetObjectRequest.builder().bucket(testBucket).key(KEY).build();
Expand All @@ -346,6 +346,7 @@ public void s3Presigner_withS3ExpressAuthDisabled_presignsS3ExpressRequestSucces

S3Presigner presigner = S3Presigner.builder()
.region(TEST_REGION)
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.build();

GetObjectRequest getObjectRequest = GetObjectRequest.builder().bucket(testBucket).key(KEY).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void syncEmptyObjectWithChecksumValidation_arrayRead_returnsEOF() throws

@Test
public void asyncEmptyObjectWithChecksumValidation_returnsEmpty() throws Exception {
try (S3AsyncClient s3Async = S3AsyncClient.builder().region(DEFAULT_REGION).build()) {
try (S3AsyncClient s3Async = S3AsyncClient.builder().region(DEFAULT_REGION).credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build()) {
s3Async.putObject(r -> r.bucket(BUCKET).key("x"),AsyncRequestBody.empty()).join();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public void uploadAndDownloadWithPresignedUrlWorks() throws IOException {
private void testAccessPointPresigning(String accessPointArn, String key) throws IOException {
String data = "Hello";

S3Presigner presigner = S3Presigner.builder().region(Region.US_WEST_2).build();
S3Presigner presigner = S3Presigner.builder()
.region(Region.US_WEST_2)
.credentialsProvider(CREDENTIALS_PROVIDER_CHAIN)
.build();

SdkHttpRequest presignedPut = presigner.presignPutObject(r -> r.signatureDuration(Duration.ofDays(7))
.putObjectRequest(por -> por.bucket(accessPointArn)
Expand Down
Loading