Skip to content

Commit b9d4a49

Browse files
committed
ci: copy and run the ESDK tests through the busy-bucket
Signed-off-by: texastony <[email protected]>
1 parent 5495e7d commit b9d4a49

File tree

2 files changed

+290
-5
lines changed

2 files changed

+290
-5
lines changed

codebuild/ci/busy-bucket-pom.xml

+286
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>sfw.example.esdkworkshop</groupId>
8+
<artifactId>esdkworkshop</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<name>esdkworkshop</name>
12+
<description>The Busy Engineer's Document Bucket Workshop</description>
13+
<url>https://document-bucket.awssecworkshops.com</url>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<maven.compiler.source>11</maven.compiler.source>
18+
<maven.compiler.target>11</maven.compiler.target>
19+
<esdk.version>2.2.0</esdk.version>
20+
</properties>
21+
22+
<dependencies>
23+
<dependency>
24+
<groupId>org.bouncycastle</groupId>
25+
<artifactId>bcprov-ext-jdk15on</artifactId>
26+
<version>1.69</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.apache.commons</groupId>
30+
<artifactId>commons-lang3</artifactId>
31+
<version>3.12.0</version>
32+
</dependency>
33+
34+
<dependency>
35+
<groupId>com.google.code.findbugs</groupId>
36+
<artifactId>jsr305</artifactId>
37+
<version>3.0.2</version>
38+
<scope>provided</scope>
39+
</dependency>
40+
<dependency>
41+
<groupId>com.google.code.findbugs</groupId>
42+
<artifactId>annotations</artifactId>
43+
<version>3.0.1</version>
44+
<scope>provided</scope>
45+
</dependency>
46+
<!-- START: test -->
47+
48+
<dependency>
49+
<groupId>org.mockito</groupId>
50+
<artifactId>mockito-core</artifactId>
51+
<version>3.11.2</version>
52+
<scope>test</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.junit.jupiter</groupId>
56+
<artifactId>junit-jupiter-api</artifactId>
57+
<version>5.7.2</version>
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.junit.vintage</groupId>
62+
<artifactId>junit-vintage-engine</artifactId>
63+
<version>5.7.2</version>
64+
<scope>test</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>org.hamcrest</groupId>
68+
<artifactId>hamcrest-all</artifactId>
69+
<version>1.3</version>
70+
<scope>test</scope>
71+
</dependency>
72+
<!-- END: test -->
73+
<dependency>
74+
<groupId>com.moandjiezana.toml</groupId>
75+
<artifactId>toml4j</artifactId>
76+
<version>0.7.2</version>
77+
<scope>compile</scope>
78+
</dependency>
79+
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk -->
80+
<dependency>
81+
<groupId>com.amazonaws</groupId>
82+
<artifactId>aws-java-sdk</artifactId>
83+
<version>1.12.26</version>
84+
<scope>compile</scope>
85+
</dependency>
86+
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-encryption-sdk-java -->
87+
<dependency>
88+
<groupId>com.amazonaws</groupId>
89+
<artifactId>aws-encryption-sdk-java</artifactId>
90+
<version>${esdk.version}</version>
91+
<scope>compile</scope>
92+
</dependency>
93+
<dependency>
94+
<groupId>software.amazon.cryptools</groupId>
95+
<artifactId>AmazonCorrettoCryptoProvider</artifactId>
96+
<version>1.2.0</version>
97+
<classifier>linux-x86_64</classifier>
98+
</dependency>
99+
</dependencies>
100+
101+
<build>
102+
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
103+
<plugins>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-checkstyle-plugin</artifactId>
107+
<version>3.1.0</version>
108+
<dependencies>
109+
<dependency>
110+
<groupId>com.puppycrawl.tools</groupId>
111+
<artifactId>checkstyle</artifactId>
112+
<version>8.29</version>
113+
</dependency>
114+
</dependencies>
115+
</plugin>
116+
<plugin>
117+
<artifactId>maven-clean-plugin</artifactId>
118+
<version>3.1.0</version>
119+
</plugin>
120+
<plugin>
121+
<artifactId>maven-site-plugin</artifactId>
122+
<version>3.7.1</version>
123+
</plugin>
124+
<plugin>
125+
<artifactId>maven-project-info-reports-plugin</artifactId>
126+
<version>3.0.0</version>
127+
</plugin>
128+
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
129+
<plugin>
130+
<artifactId>maven-resources-plugin</artifactId>
131+
<version>3.0.2</version>
132+
</plugin>
133+
<plugin>
134+
<artifactId>maven-compiler-plugin</artifactId>
135+
<version>3.8.0</version>
136+
</plugin>
137+
<plugin>
138+
<artifactId>maven-surefire-plugin</artifactId>
139+
<version>2.22.1</version>
140+
</plugin>
141+
<plugin>
142+
<artifactId>maven-failsafe-plugin</artifactId>
143+
<version>2.22.1</version>
144+
</plugin>
145+
<plugin>
146+
<artifactId>maven-jar-plugin</artifactId>
147+
<version>3.0.2</version>
148+
</plugin>
149+
<plugin>
150+
<artifactId>maven-install-plugin</artifactId>
151+
<version>2.5.2</version>
152+
</plugin>
153+
<plugin>
154+
<artifactId>maven-deploy-plugin</artifactId>
155+
<version>2.8.2</version>
156+
</plugin>
157+
<!-- Add mvn jshell:run target -->
158+
<plugin>
159+
<groupId>com.github.johnpoth</groupId>
160+
<artifactId>jshell-maven-plugin</artifactId>
161+
<version>1.1</version>
162+
</plugin>
163+
</plugins>
164+
</pluginManagement>
165+
<plugins>
166+
<plugin>
167+
<groupId>org.codehaus.mojo</groupId>
168+
<artifactId>exec-maven-plugin</artifactId>
169+
<version>1.6.0</version>
170+
<executions>
171+
<execution>
172+
<!-- https://www.mojohaus.org/exec-maven-plugin/examples/example-exec-for-java-programs.html -->
173+
<goals>
174+
<goal>java</goal>
175+
</goals>
176+
</execution>
177+
</executions>
178+
<configuration>
179+
<mainClass>sfw.example.esdkworkshop.App</mainClass>
180+
</configuration>
181+
</plugin>
182+
<plugin>
183+
<groupId>org.codehaus.mojo</groupId>
184+
<artifactId>build-helper-maven-plugin</artifactId>
185+
<version>3.2.0</version>
186+
<executions>
187+
<execution>
188+
<id>add-test-source</id>
189+
<phase>generate-test-sources</phase>
190+
<goals>
191+
<goal>add-test-source</goal>
192+
</goals>
193+
<configuration>
194+
<sources>
195+
<source>src/main/java/com/amazonaws/crypto/examples/</source>
196+
</sources>
197+
</configuration>
198+
</execution>
199+
</executions>
200+
</plugin>
201+
<plugin>
202+
<groupId>org.apache.maven.plugins</groupId>
203+
<artifactId>maven-checkstyle-plugin</artifactId>
204+
<version>3.1.0</version>
205+
<configuration>
206+
<configLocation>checkstyle.xml</configLocation>
207+
<encoding>UTF-8</encoding>
208+
<consoleOutput>true</consoleOutput>
209+
<failsOnError>true</failsOnError>
210+
<linkXRef>false</linkXRef>
211+
</configuration>
212+
<executions>
213+
<execution>
214+
<id>validate</id>
215+
<phase>validate</phase>
216+
<goals>
217+
<goal>check</goal>
218+
</goals>
219+
</execution>
220+
</executions>
221+
</plugin>
222+
<plugin>
223+
<groupId>com.github.spotbugs</groupId>
224+
<artifactId>spotbugs-maven-plugin</artifactId>
225+
<version>3.1.12.2</version>
226+
<executions>
227+
<execution>
228+
<phase>verify</phase>
229+
<goals>
230+
<goal>check</goal>
231+
</goals>
232+
</execution>
233+
</executions>
234+
<dependencies>
235+
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
236+
<dependency>
237+
<groupId>com.github.spotbugs</groupId>
238+
<artifactId>spotbugs</artifactId>
239+
<version>4.0.0-beta4</version>
240+
</dependency>
241+
</dependencies>
242+
</plugin>
243+
<plugin>
244+
<groupId>com.coveo</groupId>
245+
<artifactId>fmt-maven-plugin</artifactId>
246+
<version>2.9</version>
247+
<executions>
248+
<execution>
249+
<goals>
250+
<goal>
251+
format
252+
</goal>
253+
</goals>
254+
</execution>
255+
</executions>
256+
</plugin>
257+
<plugin>
258+
<groupId>org.jacoco</groupId>
259+
<artifactId>jacoco-maven-plugin</artifactId>
260+
<version>0.8.5</version>
261+
<executions>
262+
<execution>
263+
<goals>
264+
<goal>prepare-agent</goal>
265+
</goals>
266+
</execution>
267+
<execution>
268+
<id>report</id>
269+
<phase>test</phase>
270+
<goals>
271+
<goal>report</goal>
272+
</goals>
273+
</execution>
274+
</executions>
275+
</plugin>
276+
</plugins>
277+
</build>
278+
279+
<reporting>
280+
<plugins>
281+
<plugin>
282+
<artifactId>maven-project-info-reports-plugin</artifactId>
283+
</plugin>
284+
</plugins>
285+
</reporting>
286+
</project>

codebuild/ci/validate-ci.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ phases:
1616
java: $JAVA_ENV_VERSION
1717
pre_build:
1818
commands:
19-
- export SRC_DIR=$(pwd)
2019
- VERSION_HASH="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$CODEBUILD_RESOLVED_SOURCE_VERSION"
2120
- export SETTINGS_FILE=$(pwd)/codebuild/ci/settings.xml
2221
- git clone https://github.com/aws-samples/busy-engineers-document-bucket.git
@@ -38,9 +37,11 @@ phases:
3837
-s $SETTINGS_FILE
3938
post_build:
4039
commands:
41-
- cd $$CODEBUILD_SRC_DIR
40+
- cp -r $CODEBUILD_SRC_DIR/src/test/ src/test
41+
- cp -r $CODEBUILD_SRC_DIR/src/examples/java/com src/main/java/
42+
- cp $CODEBUILD_SRC_DIR/codebuild/ci/busy-bucket-pom.xml pom.xml
4243
- |
43-
mvn verify \
44+
mvn test \
4445
-Pcodeartifact \
4546
-Dcheckstyle.skip \
4647
-Desdk.version=$VERSION_HASH \
@@ -52,5 +53,3 @@ phases:
5253
-Dgpg.skip=true \
5354
"-DtestVectorZip=file://$CODEBUILD_SRC_DIR/src/test/resources/aws-encryption-sdk-test-vectors/vectors/awses-decrypt/python-2.3.0-mrks.zip" \
5455
-s $SETTINGS_FILE
55-
56-

0 commit comments

Comments
 (0)