Skip to content

Commit ee99b3c

Browse files
szirbuczmagwas
authored andcommitted
Devops/separate test types 132 (#298)
* Separate phase for integration tests #132 * Move integration tests to separate directory #132
1 parent 02c769b commit ee99b3c

File tree

11 files changed

+71
-12
lines changed

11 files changed

+71
-12
lines changed

.classpath

+6
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,11 @@
2828
<attribute name="maven.pomderived" value="true"/>
2929
</attributes>
3030
</classpathentry>
31+
<classpathentry kind="src" output="target/test-classes" path="src/integration-test/java">
32+
<attributes>
33+
<attribute name="optional" value="true"/>
34+
<attribute name="maven.pomderived" value="true"/>
35+
</attributes>
36+
</classpathentry>
3137
<classpathentry kind="output" path="target/classes"/>
3238
</classpath>

.project

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
</arguments>
2727
</buildCommand>
2828
<buildCommand>
29-
<name>org.eclipse.m2e.core.maven2Builder</name>
29+
<name>ch.acanda.eclipse.pmd.builder.PMDBuilder</name>
3030
<arguments>
3131
</arguments>
3232
</buildCommand>
3333
<buildCommand>
34-
<name>ch.acanda.eclipse.pmd.builder.PMDBuilder</name>
34+
<name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
3535
<arguments>
3636
</arguments>
3737
</buildCommand>
3838
<buildCommand>
39-
<name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
39+
<name>org.eclipse.m2e.core.maven2Builder</name>
4040
<arguments>
4141
</arguments>
4242
</buildCommand>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
eclipse.preferences.version=1
2+
encoding//src/integration-test/java=UTF-8
23
encoding//src/main/java=UTF-8
34
encoding//src/test/java=UTF-8
45
encoding/<project>=UTF-8

.settings/org.eclipse.wst.common.component

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2-
<wb-module deploy-name="PDEngine-0.0.1-master.4a96649">
2+
<wb-module deploy-name="PDEngine-0.0.1-devops_separate-test-types-132.0df00bb">
33
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
44
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
55
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ javabuild: target/PDEngine-0.0.1-SNAPSHOT.jar
4141

4242
target/PDEngine-0.0.1-SNAPSHOT.jar:
4343
mvn build-helper:parse-version versions:set versions:commit -DnewVersion=\$${parsedVersion.majorVersion}.\$${parsedVersion.minorVersion}.\$${parsedVersion.incrementalVersion}-$$(tools/getbranch|sed 'sA/A_Ag').$$(git rev-parse --short HEAD)
44-
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install org.pitest:pitest-maven:mutationCoverage site
44+
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install org.pitest:pitest-maven:mutationCoverage site -Pintegration-test
4545
zenta-xslt-runner -xsl:cpd2pmd.xslt -s:target/pmd.xml -o target/pmd_full.xml
4646
java -jar /usr/local/lib/mutation-analysis-plugin-1.3-SNAPSHOT.jar
4747

pom.xml

+51-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.rulez.demokracia</groupId>
77
<artifactId>PDEngine</artifactId>
8-
<version>0.0.1-feature_for_show_vote_the_user_needs_a_counted_assurance_40.5a79d7b</version>
8+
<version>0.0.1-devops_separate-test-types-132.0df00bb</version>
99
<packaging>war</packaging>
1010

1111
<name>PDEngine</name>
@@ -53,14 +53,16 @@
5353
<plugin>
5454
<groupId>org.apache.maven.plugins</groupId>
5555
<artifactId>maven-surefire-plugin</artifactId>
56-
<version>2.7.2</version>
56+
<version>2.22.0</version>
5757
<configuration>
5858
<b>
5959
<argLine>
6060
-javaagent:${sonar.jacoco.jar}=destfile=${sonar.jacoco.reportPath}
6161
</argLine>
6262
</b>
63-
<test>**/*.java</test>
63+
<excludes>
64+
<exclude>**/*IntegrationTest</exclude>
65+
</excludes>
6466
</configuration>
6567
</plugin>
6668
<plugin>
@@ -87,8 +89,54 @@
8789
<artifactId>maven-site-plugin</artifactId>
8890
<version>3.7.1</version>
8991
</plugin>
92+
<plugin>
93+
<groupId>org.codehaus.mojo</groupId>
94+
<artifactId>build-helper-maven-plugin</artifactId>
95+
<version>1.9.1</version>
96+
<executions>
97+
<execution>
98+
<id>add-integration-test-sources</id>
99+
<phase>generate-test-sources</phase>
100+
<goals>
101+
<goal>add-test-source</goal>
102+
</goals>
103+
<configuration>
104+
<sources>
105+
<source>src/integration-test/java</source>
106+
</sources>
107+
</configuration>
108+
</execution>
109+
</executions>
110+
</plugin>
90111
</plugins>
91112
</build>
113+
114+
<profiles>
115+
<profile>
116+
<id>integration-test</id>
117+
<build>
118+
<plugins>
119+
<plugin>
120+
<artifactId>maven-failsafe-plugin</artifactId>
121+
<version>2.22.0</version>
122+
<executions>
123+
<execution>
124+
<goals>
125+
<goal>integration-test</goal>
126+
<goal>verify</goal>
127+
</goals>
128+
</execution>
129+
</executions>
130+
<configuration>
131+
<includes>
132+
<include>**/*IntegrationTest</include>
133+
</includes>
134+
</configuration>
135+
</plugin>
136+
</plugins>
137+
</build>
138+
</profile>
139+
</profiles>
92140

93141
<reporting>
94142
<plugins>

src/test/java/org/rulez/demokracia/pdengine/ChoiceDeleteAdminKeyIsUser.java src/test/java/org/rulez/demokracia/pdengine/ChoiceDeleteAdminKeyIsUserTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@TestedFeature("Manage votes")
1313
@TestedOperation("delete choice")
14-
public class ChoiceDeleteAdminKeyIsUser extends CreatedDefaultVoteRegistry {
14+
public class ChoiceDeleteAdminKeyIsUserTest extends CreatedDefaultVoteRegistry {
1515

1616
private static final String USER = "user";
1717
private static final String CHOICE1 = "choice1";

src/test/java/org/rulez/demokracia/pdengine/ForShowVoteTheUserNeedsACountedAssurance.java src/test/java/org/rulez/demokracia/pdengine/ForShowVoteTheUserNeedsACountedAssuranceTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@TestedFeature("Manage votes")
1616
@TestedOperation("show vote")
1717
@TestedBehaviour("if adminKey is anon, the user should have any of the countedAssurances")
18-
public class ForShowVoteTheUserNeedsACountedAssurance extends CreatedDefaultVoteRegistry {
18+
public class ForShowVoteTheUserNeedsACountedAssuranceTest extends CreatedDefaultVoteRegistry {
1919

2020
@Test
2121
public void a_user_with_not_all_assourances_cannot_show_the_vote() throws ReportedException {

tools/pullanalize

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ then
2121
-Dsonar.issuesReport.console.enable=true\
2222
-Dsonar.github.login=magwas\
2323
-Dsonar.externalIssuesReportPaths=issuesReport.json\
24-
-Dsonar.java.pmd.reportPaths=target/pmd_full.xml
24+
-Dsonar.java.pmd.reportPaths=target/pmd_full.xml\
25+
-Dsonar.tests=src/test,src/integration-test\
26+
-Pintegration-test
2527
else
2628
mvn sonar:sonar -Dsonar.organization=edemo\
2729
-Dsonar.java.pmd.reportPaths=target/pmd_full.xml\
2830
-Dsonar.branch.name=${BRANCH}\
29-
-Dsonar.externalIssuesReportPaths=issuesReport.json
31+
-Dsonar.externalIssuesReportPaths=issuesReport.json\
32+
-Dsonar.tests=src/test,src/integration-test\
33+
-Pintegration-test
3034
fi

0 commit comments

Comments
 (0)