Skip to content

[Do Not Merge] Temp update to travis script for testing #2045

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

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
notifications:
email:
- [email protected]
script: mvn -q install
script: mvn install -pl :codegen-generated-classes-test -am

after_success:
- bash <(curl -s https://codecov.io/bash) -F unittests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>

<!-- See SpotBugs bug: https://github.com/spotbugs/spotbugs/issues/600, https://github.com/spotbugs/spotbugs/issues/756 -->
<Match>
<Class name="software.amazon.awssdk.codegen.emitters.CodeWriter"/>
<Method name="flush"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>


<!-- If we're not sure about the RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT, skip the warning. -->
<Match>
<Package name="~software.amazon.awssdk.http.nio.netty.*"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
import software.amazon.awssdk.core.client.builder.SdkClientBuilder;
import software.amazon.awssdk.core.exception.SdkClientException;
Expand Down Expand Up @@ -83,9 +85,11 @@ public void invokeTestCase() {
testCase.callClient();
Assert.fail();
} catch (Throwable e) {
e.printStackTrace();
// Unwrap async exceptions so that they can be tested the same as async ones.
if (e instanceof CompletionException) {
e = e.getCause();
e.printStackTrace();
}

if (testCase.expectedPaths.length > 0) {
Expand Down Expand Up @@ -172,6 +176,7 @@ private static List<TestCase<?>> endpointDiscoveryRequiredAndCustomizedCases(boo
private static <T> T createClient(AwsClientBuilder<?, T> clientBuilder,
boolean endpointOverridden) {
return clientBuilder.region(Region.US_WEST_2)
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid")))
.applyMutation(c -> addEndpointOverride(c, endpointOverridden))
.overrideConfiguration(c -> c.retryPolicy(p -> p.numRetries(0))
.addExecutionInterceptor(new EndpointCapturingInterceptor()))
Expand Down