Skip to content

Commit 7965c88

Browse files
authored
Separate migration tests from regular builds (#6094)
* Separate migration tests from regular builds * Remove changelog
1 parent cb7f5c5 commit 7965c88

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

.github/workflows/codebuild-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,17 @@ jobs:
139139
uses: aws-actions/aws-codebuild-run-build@v1
140140
with:
141141
project-name: aws-sdk-java-v2-endpoints-test
142+
migration-tests:
143+
if: github.repository == 'aws/aws-sdk-java-v2'
144+
runs-on: ubuntu-latest
145+
steps:
146+
- name: Configure AWS Credentials
147+
uses: aws-actions/configure-aws-credentials@v1
148+
with:
149+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
150+
aws-region: us-west-2
151+
role-duration-seconds: 7200
152+
- name: Run migration test
153+
uses: aws-actions/aws-codebuild-run-build@v1
154+
with:
155+
project-name: aws-sdk-java-v2-migration-test

buildspecs/migration-test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
runtime-versions:
6+
java: "$JAVA_RUNTIME"
7+
8+
build:
9+
commands:
10+
- mvn clean install -pl :v2-migration-tests,:bom-internal -am -P quick $MAVEN_OPTIONS
11+
- mvn install -pl :v2-migration-tests -P migration-tests -T2C $MAVEN_OPTIONS
12+
finally:
13+
- mkdir -p codebuild-test-reports
14+
- find ./ -name 'TEST-*.xml' -type f -exec cp {} codebuild-test-reports/ \;
15+
reports:
16+
IntegTests:
17+
files:
18+
- 'codebuild-test-reports/**/*'

buildspecs/resources/ci.cloudformation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Resources:
5757
- !Sub arn:aws:codebuild:${ AWS::Region }:${ AWS::AccountId }:project/aws-sdk-java-v2-native-image-test
5858
- !Sub arn:aws:codebuild:${ AWS::Region }:${ AWS::AccountId }:project/aws-sdk-java-v2-sonar
5959
- !Sub arn:aws:codebuild:${ AWS::Region }:${ AWS::AccountId }:project/aws-sdk-java-v2-endpoints-test
60+
- !Sub arn:aws:codebuild:${ AWS::Region }:${ AWS::AccountId }:project/aws-sdk-java-v2-migration-test
6061
- Effect: Allow
6162
Action:
6263
- logs:GetLogEvents
@@ -69,6 +70,7 @@ Resources:
6970
- !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/aws-sdk-java-v2-native-image-test:*
7071
- !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/aws-sdk-java-v2-sonar:*
7172
- !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/aws-sdk-java-v2-endpoints-test:*
73+
- !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/aws-sdk-java-v2-migration-test:*
7274

7375
GithubOidc:
7476
Type: AWS::IAM::OIDCProvider

pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
<s3accessgrants.version>2.1.0</s3accessgrants.version>
192192

193193
<skip.unit.tests>${skipTests}</skip.unit.tests>
194+
<v2.migration.tests.skip>true</v2.migration.tests.skip>
194195
<integTestSourceDirectory>${project.basedir}/src/it/java</integTestSourceDirectory>
195196
<javadoc.resourcesDir>${session.executionRootDirectory}</javadoc.resourcesDir>
196197
<scm.github.url>https://github.com/aws/aws-sdk-java-v2</scm.github.url>
@@ -827,6 +828,21 @@
827828
</properties>
828829
</profile>
829830

831+
<profile>
832+
<id>migration-tests</id>
833+
<activation>
834+
<activeByDefault>false</activeByDefault>
835+
</activation>
836+
<properties>
837+
<v2.migration.tests.skip>false</v2.migration.tests.skip>
838+
<checkstyle.skip>true</checkstyle.skip>
839+
<spotbugs.skip>true</spotbugs.skip>
840+
<mdep.analyze.skip>true</mdep.analyze.skip>
841+
<japicmp.skip>true</japicmp.skip>
842+
<javadoc.skip>true</javadoc.skip>
843+
</properties>
844+
</profile>
845+
830846
<profile>
831847
<id>integration-tests</id>
832848
<activation>

test/v2-migration-tests/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,17 @@
163163
<skip>true</skip>
164164
</configuration>
165165
</plugin>
166+
<plugin>
167+
<artifactId>maven-surefire-plugin</artifactId>
168+
<configuration>
169+
<!-- Separate Codebuild for migration tests -->
170+
<skipTests>${v2.migration.tests.skip}</skipTests>
171+
<!-- Sets the VM argument line used when migration tests are run. -->
172+
<argLine>${argLine}</argLine>
173+
<trimStackTrace>false</trimStackTrace>
174+
<rerunFailingTestsCount>2</rerunFailingTestsCount>
175+
</configuration>
176+
</plugin>
166177
</plugins>
167178
</build>
168179

0 commit comments

Comments
 (0)