Skip to content

Commit e6e7e40

Browse files
committed
try running the junit through eclipse instead of surefire
1 parent 7ab7c0b commit e6e7e40

File tree

3 files changed

+53
-37
lines changed

3 files changed

+53
-37
lines changed

.mvn/extensions.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<extensions>
33
<extension>
4-
<groupId>org.eclipse.tycho.extras</groupId>
5-
<artifactId>tycho-pomless</artifactId>
4+
<groupId>org.eclipse.tycho</groupId>
5+
<artifactId>tycho-build</artifactId>
66
<version>4.0.12</version>
77
</extension>
88
</extensions>

Jenkinsfile

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ pipeline {
1010
MVN_QUALITY_PROFILES = '-P full'
1111
JACOCO_EXEC_FILE_PATH = '${WORKSPACE}/jacoco.exec'
1212
BUILD_KEY = (github.isPullRequest() ? CHANGE_TARGET : BRANCH_NAME).replaceFirst(/^v/, '')
13+
CAPELLA_PRODUCT_PATH = "${WORKSPACE}/capella/capella"
14+
CAPELLA_BRANCH = 'master'
1315
}
1416
stages {
1517
stage('Generate TP') {
@@ -60,29 +62,63 @@ pipeline {
6062
}
6163
}
6264
}
63-
stage('Run tests') {
64-
steps {
65-
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
66-
script {
67-
// Launch test
68-
sh 'mvn -Dmaven.test.failure.ignore=true -Dtycho.localArtifacts=ignore integration-test -P tests -e -f pom.xml'
69-
}
65+
stage('Download Capella') {
66+
steps {
67+
script {
68+
def capellaURL = capella.getDownloadURL("${CAPELLA_BRANCH}", 'linux', '')
69+
70+
sh "curl -k -o capella.tar.gz ${capellaURL}"
71+
sh "tar xvzf capella.tar.gz"
72+
73+
}
74+
}
75+
}
76+
77+
stage('Install test features') {
78+
steps {
79+
script {
80+
sh "chmod 755 ${CAPELLA_PRODUCT_PATH}"
81+
sh "chmod 755 ${WORKSPACE}/capella/jre/bin/java"
82+
83+
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", capella.getTestUpdateSiteURL("${CAPELLA_BRANCH}"), 'org.polarsys.capella.test.feature.feature.group', "-Dlogback.configurationFile=${CAPELLA_PRODUCT_PATH}/configuration/logback.xml")
84+
85+
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", "file:/${WORKSPACE}/releng/org.polarsys.capella.docgen.site/target/repository/".replace("\\", "/"), 'org.polarsys.capella.docgen.feature.feature.group', "-Dlogback.configurationFile=${CAPELLA_PRODUCT_PATH}/configuration/logback.xml")
86+
eclipse.installFeature("${CAPELLA_PRODUCT_PATH}", "file:/${WORKSPACE}/releng/org.polarsys.capella.docgen.site/target/repository/".replace("\\", "/"), 'org.polarsys.capella.docgen.test.ju', "-Dlogback.configurationFile=${CAPELLA_PRODUCT_PATH}/configuration/logback.xml")
87+
88+
}
89+
}
90+
}
91+
92+
stage('Run tests') {
93+
steps {
94+
script {
95+
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
96+
97+
tester.runUITests("${CAPELLA_PRODUCT_PATH}", 'CommandLineTestSuite', 'org.polarsys.capella.docgen.test.ju',
98+
['org.polarsys.capella.docgen.test.ju.suites.CommandLineTestSuite'])
99+
tester.runUITests("${CAPELLA_PRODUCT_PATH}", 'IFESampleTestSuite', 'org.polarsys.capella.docgen.test.ju',
100+
['org.polarsys.capella.docgen.test.ju.suites.IFESampleTestSuite'])
101+
}
102+
103+
tester.publishTests()
70104
}
71105
}
72106
}
73-
stage('Publish results') {
74-
steps {
75-
junit allowEmptyResults: true, testResults: '*.xml,**/target/surefire-reports/*.xml'
76-
sh "mvn -Djacoco.dataFile=$JACOCO_EXEC_FILE_PATH org.jacoco:jacoco-maven-plugin:$JACOCO_VERSION:report $MVN_QUALITY_PROFILES -e -f pom.xml"
77-
archiveArtifacts artifacts: 'tests/**'
78-
}
79-
}
107+
108+
80109
stage('Perform Sonar analysis') {
81110
steps {
82111
script {
83112
sonar.runSonar("eclipse-capella_capella-xhtml-docgen", "eclipse/capella-xhtml-docgen", "sonar-token-capella-xhtml-docgen")
84113
}
85114
}
86115
}
116+
117+
87118
}
119+
post {
120+
always {
121+
archiveArtifacts artifacts: '**/*.log, *.log, *.xml, **/*.layout'
122+
}
123+
}
88124
}

tests/plugins/org.polarsys.capella.docgen.test.ju/pom.xml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,7 @@
3232
</properties>
3333

3434
<build>
35-
<plugins>
36-
<plugin>
37-
<groupId>org.eclipse.tycho</groupId>
38-
<artifactId>tycho-surefire-plugin</artifactId>
39-
<version>${tycho-version}</version>
40-
<configuration>
41-
<product>${capella-rcp-product-id}</product>
42-
<application>${capella-application-id}</application>
43-
<useUIHarness>true</useUIHarness>
44-
<useUIThread>true</useUIThread>
45-
<includes>**/*TestSuite.java</includes>
46-
<dependencies>
47-
<!-- see https://bugs.eclipse.org/bugs/show_bug.cgi?id=462862 -->
48-
<dependency>
49-
<type>eclipse-plugin</type>
50-
<artifactId>org.eclipse.equinox.event</artifactId>
51-
<version>0.0.0</version>
52-
</dependency>
53-
</dependencies>
54-
</configuration>
55-
</plugin>
35+
<plugins>
5636
<plugin>
5737
<groupId>org.eclipse.tycho</groupId>
5838
<artifactId>target-platform-configuration</artifactId>

0 commit comments

Comments
 (0)