Skip to content

Commit 2be5b07

Browse files
committed
infra: add ITs placeholder
1 parent bb1f8c1 commit 2be5b07

File tree

4 files changed

+69
-3
lines changed

4 files changed

+69
-3
lines changed

.ci/travis.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ set -euo pipefail
55
case "$1" in
66

77
install)
8+
mvn -e clean install
9+
;;
10+
11+
integration-tests)
812
SONAR_APP_VERSION="7.9.2"
913
if [[ ! -f ~/.m2/sonar-application-$SONAR_APP_VERSION.zip ]]; then
1014
URL="https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarqube/"
1115
URL=$URL"sonar-application/$SONAR_APP_VERSION/sonar-application-$SONAR_APP_VERSION.zip"
1216
wget $URL -O ~/.m2/sonar-application-$SONAR_APP_VERSION.zip
1317
fi
14-
mvn -e clean install
18+
mvn -e integration-test -DskipITs=false
1519
;;
1620

1721
nondex)

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ branches:
2222
matrix:
2323
fast_finish: true
2424
include:
25-
# verify
2625
- jdk: openjdk8
2726
env: CMD="./.ci/travis.sh install"
2827

29-
# package
28+
- jdk: openjdk8
29+
env: CMD="./.ci/travis.sh integration-tests"
30+
3031
- jdk: openjdk8
3132
env: CMD="./.ci/travis.sh nondex"

pom.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106
</maven.sevntu.checkstyle.plugin.checkstyle.version>
107107
<java.version>1.8</java.version>
108108
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
109+
<!-- we disable ITs by default as it need download of 200MB sonar application jar -->
110+
<skipITs>true</skipITs>
109111
</properties>
110112

111113
<dependencies>
@@ -287,6 +289,25 @@
287289
<target>${java.version}</target>
288290
</configuration>
289291
</plugin>
292+
<plugin>
293+
<groupId>org.codehaus.mojo</groupId>
294+
<artifactId>build-helper-maven-plugin</artifactId>
295+
<version>3.0.0</version>
296+
<executions>
297+
<execution>
298+
<id>add-test-source</id>
299+
<phase>generate-test-sources</phase>
300+
<goals>
301+
<goal>add-test-source</goal>
302+
</goals>
303+
<configuration>
304+
<sources>
305+
<source>src/it/java</source>
306+
</sources>
307+
</configuration>
308+
</execution>
309+
</executions>
310+
</plugin>
290311
<plugin>
291312
<groupId>org.apache.maven.plugins</groupId>
292313
<artifactId>maven-release-plugin</artifactId>
@@ -299,6 +320,30 @@
299320
<groupId>org.apache.maven.plugins</groupId>
300321
<artifactId>maven-surefire-plugin</artifactId>
301322
<version>2.22.1</version>
323+
<configuration>
324+
<includes>
325+
<include>org/sonar/**/*.java</include>
326+
</includes>
327+
</configuration>
328+
</plugin>
329+
<plugin>
330+
<groupId>org.apache.maven.plugins</groupId>
331+
<artifactId>maven-failsafe-plugin</artifactId>
332+
<version>2.22.2</version>
333+
<configuration>
334+
<skipITs>${skipITs}</skipITs>
335+
<includes>
336+
<include>org/checkstyle/**/*.java</include>
337+
</includes>
338+
</configuration>
339+
<executions>
340+
<execution>
341+
<goals>
342+
<goal>integration-test</goal>
343+
<goal>verify</goal>
344+
</goals>
345+
</execution>
346+
</executions>
302347
</plugin>
303348
<plugin>
304349
<groupId>org.apache.maven.plugins</groupId>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.checkstyle.plugins.sonar;
2+
3+
import static org.junit.Assert.assertTrue;
4+
5+
import java.io.File;
6+
7+
import org.junit.Test;
8+
9+
public class CheckJarTest {
10+
11+
@Test
12+
public void testJarPresence() {
13+
assertTrue("Jar should exists",
14+
new File("target/checkstyle-sonar-plugin-4.28-SNAPSHOT.jar").exists());
15+
}
16+
}

0 commit comments

Comments
 (0)