Skip to content
Permalink
Browse files

Add OE 12.0 code coverage in SonarQube analysis (#356)

  • Loading branch information...
gquerret committed Mar 28, 2019
1 parent 7badf2f commit bd5ad2a3486046f116267665982bcf11c518e7d3
@@ -44,7 +44,7 @@ stage('Full tests') {
branch5: { testBranch('linux', 'OpenEdge-11.7', false, '11.7-Linux', 11, 64) },
branch6: { testBranch('linux', 'OpenEdge-10.2B', false, '10.2-Linux', 10, 32) },
branch7: { testBranch('linux', 'OpenEdge-12.0', false, '12.0-Linux', 12, 64) },
branch8: { testBranch('windows', 'OpenEdge-12.0', false, '12.0-Win', 12, 64) },
branch8: { testBranch('windows', 'OpenEdge-12.0', true, '12.0-Win', 12, 64) },
failFast: false
node('linux') {
// Wildcards not accepted in unstash...
@@ -73,7 +73,8 @@ stage('Sonar') {
node('linux') {
def antHome = tool name: 'Ant 1.9', type: 'hudson.tasks.Ant$AntInstallation'
def dlc = tool name: 'OpenEdge-11.7', type: 'jenkinsci.plugin.openedge.OpenEdgeInstallation'
unstash name: 'coverage'
unstash name: 'coverage-11.7-Win'
unstash name: 'coverage-12.0-Win'
withCredentials([string(credentialsId: 'AdminTokenSonarQube', variable: 'SQ_TOKEN')]) {
sh "${antHome}/bin/ant -lib lib/sonarqube-ant-task-2.5.jar -f sonar.xml -Dsonar.login=${env.SQ_TOKEN} -DSONAR_URL=http://sonar.riverside-software.fr -DBRANCH_NAME=${env.BRANCH_NAME} -DDLC=${dlc} sonar"
}
@@ -96,7 +97,7 @@ def testBranch(nodeName, dlcVersion, stashCoverage, label, majorVersion, arch) {
stash name: "junit-${label}", includes: 'junitreports-*.zip'
archiveArtifacts 'emailable-report-*.html'
if (stashCoverage) {
stash name: 'coverage', includes: 'profiler/jacoco.exec,oe-profiler-data.zip'
stash name: "coverage-${label}", includes: "profiler/jacoco-${label}.exec,oe-profiler-data-${label}.zip"
}
}
}
@@ -16,7 +16,7 @@
<property name="sonar.sourceEncoding" value="iso8859-1" />
<property name="sonar.oe.binaries" value="build/build-v11" />
<property name="sonar.java.binaries" value="build/java" />
<property name="sonar.jacoco.reportPaths" value="profiler/jacoco.exec" />
<property name="sonar.jacoco.reportPaths" value="profiler/jacoco-11.7-Win.exec,profiler/jacoco-12.0-Win.exec" />
<!-- See http://jira.codehaus.org/browse/SONARPLUGINS-1194 -->
<pathconvert property="sonar.java.libraries" pathsep="," refid="lib.cp" />
<property name="sonar.oe.propath" value="src/progress" />
@@ -37,7 +37,10 @@
</taskdef>
<touch file="dictdb.df" />
<mkdir dir="profiler/progress" />
<unzip src="oe-profiler-data.zip" dest="profiler/progress">
<unzip src="oe-profiler-data-11.7-Win.zip" dest="profiler/progress">
<flattenmapper />
</unzip>
<unzip src="oe-profiler-data-12.0-Win.zip" dest="profiler/progress" overwrite="true">
<flattenmapper />
</unzip>
<sonar:sonar />
@@ -408,4 +408,12 @@ public void test48() {
executeTarget("test1");
expectBuildException("test2", "Invalid env variable");
}

@Test(groups = {"v10"})
public void test49() {
configureProject("PCTRun/test49/build.xml");
executeTarget("test");
File f = new File("PCTRun/test49/profiler");
assertEquals(f.listFiles().length, 1);
}
}
@@ -72,7 +72,7 @@
<mkdir dir="profiler" />
<taskdef resource="testngtasks" classpathref="testng.cp" />
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpathref="jacoco.cp" />
<jacoco:coverage destFile="profiler/jacoco.exec">
<jacoco:coverage destFile="profiler/jacoco-${TESTENV}.exec">
<testng workingDir="testbox" outputdir="test-output" useDefaultListeners="true" groups="${GROUPS}" excludedGroups="${EXCLUDES-OS},${EXCLUDES-VERSION}" suiteName="${TESTENV} tests">
<classfileset dir="build/test" includes="**/*Test.class" excludes="**/*BrokerTest.class" />
<classpath refid="test.run.cp" />
@@ -83,7 +83,7 @@

<target name="dist" depends="test">
<copy file="test-output/emailable-report.html" tofile="emailable-report-${TESTENV}.html" />
<zip destFile="oe-profiler-data.zip">
<zip destFile="oe-profiler-data-${TESTENV}.zip">
<fileset dir="testbox" includes="**/profiler*.out" />
</zip>
<zip destFile="junitreports-${TESTENV}.zip">
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<project name="PCTRun-test49">
<taskdef resource="PCT.properties" />

<target name="test">
<mkdir dir="profiler" />
<PCTRun graphicalMode="false" procedure="test.p" dlcHome="${DLC}">
<Profiler enabled="true" coverage="true" outputDir="profiler" />
</PCTRun>
</target>

</project>
@@ -0,0 +1,5 @@
PROFILER:USER-DATA("User data in profiler").
PROFILER:TRACE-FILTER = "*.p".
RUN test2.p.

RETURN "0".
@@ -0,0 +1 @@
MESSAGE "Test2".

0 comments on commit bd5ad2a

Please sign in to comment.
You can’t perform that action at this time.