Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Add support for touchStoneCombinationFilter and ...
Browse files Browse the repository at this point in the history
touchstoneResultCondition
  • Loading branch information
fredg02 committed Jan 15, 2018
1 parent 92a9ccf commit 193cab4
Show file tree
Hide file tree
Showing 6 changed files with 544 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/resources/xsl/config.job.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@
<xsl:apply-templates select="project-properties/entry [contains(string/text(), 'TimestamperBuildWrapper')]" />
<xsl:apply-templates select="project-properties/entry [contains(string/text(), 'LockWrapper')]"/>
</buildWrappers>
<xsl:if test="/matrix-project">
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<xsl:apply-templates select="runSequentially"/>
<xsl:apply-templates select="project-properties/entry [string/text() = 'touchStoneCombinationFilter']"/>
<xsl:apply-templates select="project-properties/entry [string/text() = 'touchStoneResultCondition']"/>
</executionStrategy>
</xsl:if>
</xsl:element>
</xsl:template>

Expand All @@ -95,6 +102,11 @@
<xsl:copy-of select="." />
</xsl:template>

<!-- Matches for Matrix job -->
<xsl:template match="runSequentially">
<xsl:copy-of select="." />
</xsl:template>

<!-- Standard identity template to copy input document -->
<!--
<xsl:template match="@*|node()">
Expand Down Expand Up @@ -216,6 +228,20 @@
</xsl:element>
</xsl:template>

<!-- Touchstone combination filter -->
<xsl:template match="/*/project-properties/entry [string/text() = 'touchStoneCombinationFilter']">
<xsl:element name="touchStoneCombinationFilter">
<xsl:copy-of select="*/originalValue/text()" />
</xsl:element>
</xsl:template>

<!-- Touchstone result condition -->
<xsl:template match="/*/project-properties/entry [string/text() = 'touchStoneResultCondition']">
<xsl:element name="touchStoneResultCondition">
<xsl:copy-of select="*/originalValue/*" />
</xsl:element>
</xsl:template>

<!-- String, Int, Boolean, etc -->
<xsl:template match="/*/project-properties/entry [(*/originalValue/@class = 'string' or */originalValue/@class = 'int' or */originalValue/@class = 'boolean' or */originalValue/@class = '') and not(string/text() = 'cleanWorkspaceRequired')]">
<xsl:variable name="tagName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ public void configJobTest_recommenders() {
transformAndCompare("recommenders", "config.job.hudson", "matrix-project");
}

/**
* Tests that "Execute touchstone builds first" is transformed correctly
*/
@Test
public void configJobTest_recommenders2() {
transformAndCompare("recommenders2", "config.job.hudson", "matrix-project");
}

@Test
public void copyViewsTest_positive() {
testCopyViews("config.main.jenkins-cbi.xml", "config.main.hudson-cbi.xml");
Expand Down
321 changes: 321 additions & 0 deletions xml/original/config.job.hudson-recommenders2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions/>
<description></description>
<project-properties class="java.util.concurrent.ConcurrentHashMap">
<entry>
<string>hudson-plugins-checkstyle-CheckStylePublisher</string>
<external-property>
<originalValue class="hudson.plugins.checkstyle.CheckStylePublisher">
<healthy></healthy>
<unHealthy></unHealthy>
<thresholdLimit>low</thresholdLimit>
<pluginName>[CHECKSTYLE] </pluginName>
<defaultEncoding></defaultEncoding>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll></unstableTotalAll>
<unstableTotalHigh></unstableTotalHigh>
<unstableTotalNormal></unstableTotalNormal>
<unstableTotalLow></unstableTotalLow>
<failedTotalAll></failedTotalAll>
<failedTotalHigh></failedTotalHigh>
<failedTotalNormal></failedTotalNormal>
<failedTotalLow></failedTotalLow>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern></pattern>
</originalValue>
<propertyOverridden>false</propertyOverridden>
<modified>true</modified>
</external-property>
</entry>
<entry>
<string>hudson-plugins-disk_usage-DiskUsageProperty</string>
<base-property>
<originalValue class="hudson.plugins.disk_usage.DiskUsageProperty"/>
<propertyOverridden>false</propertyOverridden>
</base-property>
</entry>
<entry>
<string>logRotator</string>
<log-rotator-property>
<originalValue class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>10</numToKeep>
<artifactDaysToKeep>7</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</log-rotator-property>
</entry>
<entry>
<string>hudson-plugins-xvnc-Xvnc</string>
<external-property>
<originalValue class="hudson.plugins.xvnc.Xvnc">
<takeScreenshot>false</takeScreenshot>
</originalValue>
<propertyOverridden>false</propertyOverridden>
<modified>true</modified>
</external-property>
</entry>
<entry>
<string>axes</string>
<axis-list-property>
<originalValue class="hudson.matrix.AxisList">
<hudson.matrix.JDKAxis>
<name>jdk</name>
<values>
<string>jdk-1.8.0-latest</string>
<string>jdk-1.7.0-latest</string>
</values>
</hudson.matrix.JDKAxis>
<hudson.matrix.TextAxis>
<name>simrel</name>
<values>
<string>kepler</string>
<string>luna</string>
<string>mars</string>
<string>neon</string>
</values>
</hudson.matrix.TextAxis>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</axis-list-property>
</entry>
<entry>
<string>combinationFilter</string>
<string-property>
<originalValue class="string">((simrel == &quot;kepler&quot; || simrel == &quot;luna&quot; || simrel == &quot;mars&quot;) &amp;&amp; jdk == &quot;jdk-1.7.0-latest&quot;) || (simrel == &quot;neon&quot; &amp;&amp; jdk == &quot;jdk-1.8.0-latest&quot;)</originalValue>
<propertyOverridden>false</propertyOverridden>
</string-property>
</entry>
<entry>
<string>hudson-tasks-junit-JUnitResultArchiver</string>
<external-property>
<originalValue class="hudson.tasks.junit.JUnitResultArchiver">
<testResults>**/target/surefire-reports/*.xml</testResults>
<keepLongStdio>false</keepLongStdio>
<testDataPublishers/>
</originalValue>
<propertyOverridden>false</propertyOverridden>
<modified>true</modified>
</external-property>
</entry>
<entry>
<string>parametersDefinitionProperties</string>
<copy-write-list-property>
<originalValue class="hudson.util.CopyOnWriteList">
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>GERRIT_REFSPEC</name>
<description>Normally, supplied by Gerrit. Used here as a workaround such that &lt;i&gt;Build Now&lt;/i&gt; also works (and builds the master branch). See the &lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger#GerritTrigger-Using%22BuildNow%22&quot;&gt;Jenkins Wiki&lt;/a&gt; for details.</description>
<defaultValue>master</defaultValue>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</copy-write-list-property>
</entry>
<entry>
<string>hudson-plugins-build_timeout-BuildTimeoutWrapper</string>
<external-property>
<originalValue class="hudson.plugins.build_timeout.BuildTimeoutWrapper">
<timeoutMinutes>3</timeoutMinutes>
<failBuild>false</failBuild>
<writingDescription>false</writingDescription>
<timeoutPercentage>200</timeoutPercentage>
<timeoutType>elastic</timeoutType>
<timeoutMinutesElasticDefault>60</timeoutMinutesElasticDefault>
</originalValue>
<propertyOverridden>false</propertyOverridden>
<modified>true</modified>
</external-property>
</entry>
<entry>
<string>builders</string>
<describable-list-property>
<originalValue class="hudson.util.DescribableList">
<hudson.tasks.Shell>
<command># Manual implementation of the &quot;Clean after checkout&quot; option of the Hudson Git plugin.
# See &lt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=464597&gt;.
git clean -fdx -e .maven/</command>
</hudson.tasks.Shell>
<maven-builder>
<config>
<installationId>apache-maven-latest</installationId>
<goals>clean verify</goals>
<privateRepository>true</privateRepository>
<privateTmpdir>true</privateTmpdir>
<pomFile>pom.xml</pomFile>
<properties>
<entries>
<entry name="tycho.disableP2Mirrors" value="true"/>
<entry name="installAtEnd" value="true"/>
<entry name="deployAtEnd" value="true"/>
<entry name="tycho.localArtifacts" value="ignore"/>
</entries>
</properties>
<errors>true</errors>
<verbosity>NORMAL</verbosity>
<offline>false</offline>
<snapshotUpdateMode>NORMAL</snapshotUpdateMode>
<recursive>true</recursive>
<checksumMode>STRICT</checksumMode>
<failMode>NORMAL</failMode>
<makeMode>NONE</makeMode>
<settingsId>NONE</settingsId>
<globalSettingsId>NONE</globalSettingsId>
<toolChainsId>NONE</toolChainsId>
</config>
</maven-builder>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</describable-list-property>
</entry>
<entry>
<string>touchStoneResultCondition</string>
<result-property>
<originalValue class="hudson.model.Result">
<name>SUCCESS</name>
<ordinal>0</ordinal>
<color>GREEN</color>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</result-property>
</entry>
<entry>
<string>com-sonyericsson-hudson-plugins-gerrit-trigger-hudsontrigger-GerritTrigger</string>
<trigger-property>
<originalValue class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger">
<spec></spec>
<gerritProjects>
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
<compareType>ANT</compareType>
<pattern>recommenders.incubator/org.eclipse.recommenders.privacy</pattern>
<branches>
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
<compareType>ANT</compareType>
<pattern>**</pattern>
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
</branches>
</com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
</gerritProjects>
<silentMode>false</silentMode>
<escapeQuotes>true</escapeQuotes>
<buildStartMessage></buildStartMessage>
<buildFailureMessage></buildFailureMessage>
<buildSuccessfulMessage></buildSuccessfulMessage>
<buildUnstableMessage></buildUnstableMessage>
<buildNotBuiltMessage></buildNotBuiltMessage>
<buildUnsuccessfulFilepath></buildUnsuccessfulFilepath>
<customUrl></customUrl>
<triggerOnEvents>
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent/>
<com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
</triggerOnEvents>
<dynamicTriggerConfiguration>false</dynamicTriggerConfiguration>
<triggerConfigURL></triggerConfigURL>
<triggerInformationAction/>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</trigger-property>
</entry>
<entry>
<string>scm</string>
<scm-property>
<originalValue class="hudson.plugins.git.GitSCM">
<configVersion>1</configVersion>
<remoteRepositories>
<RemoteConfig>
<name>origin</name>
<uris>
<org.eclipse.jgit.transport.URIish>
<scheme>git</scheme>
<path>/gitroot/recommenders.incubator/org.eclipse.recommenders.privacy.git</path>
<rawPath>/gitroot/recommenders.incubator/org.eclipse.recommenders.privacy.git</rawPath>
<port>-1</port>
<host>git.eclipse.org</host>
</org.eclipse.jgit.transport.URIish>
</uris>
<pushURIs/>
<fetch>
<org.eclipse.jgit.transport.RefSpec>
<force>false</force>
<wildcard>false</wildcard>
<srcName>$GERRIT_REFSPEC</srcName>
</org.eclipse.jgit.transport.RefSpec>
</fetch>
<push/>
<uploadpack>git-upload-pack</uploadpack>
<receivepack>git-receive-pack</receivepack>
<tagopt>AUTO_FOLLOW</tagopt>
<mirror>false</mirror>
<timeout>0</timeout>
<relativeTargetDir></relativeTargetDir>
</RemoteConfig>
</remoteRepositories>
<branches>
<hudson.plugins.git.BranchSpec>
<name>$GERRIT_BRANCH</name>
</hudson.plugins.git.BranchSpec>
</branches>
<mergeOptions/>
<recursiveSubmodules>false</recursiveSubmodules>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<authorOrCommitter>false</authorOrCommitter>
<clean>false</clean>
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser">
<separator>#</separator>
</buildChooser>
<gitTool>Default</gitTool>
<submoduleCfg class="list"/>
<includedRegions></includedRegions>
<excludedRegions></excludedRegions>
<excludedUsers></excludedUsers>
<excludedCommits/>
<gitConfigName></gitConfigName>
<gitConfigEmail></gitConfigEmail>
<skipTag>false</skipTag>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</scm-property>
</entry>
<entry>
<string>touchStoneCombinationFilter</string>
<string-property>
<originalValue class="string">simrel == &quot;neon&quot; &amp;&amp; jdk == &quot;jdk-1.8.0-latest&quot;</originalValue>
<propertyOverridden>false</propertyOverridden>
</string-property>
</entry>
</project-properties>
<keepDependencies>false</keepDependencies>
<createdBy>someone@somewhere.com</createdBy>
<creationTime>1424720314688</creationTime>
<properties/>
<cascadingChildrenNames class="java.util.concurrent.CopyOnWriteArraySet"/>
<cascading-job-properties class="java.util.concurrent.CopyOnWriteArraySet">
<string>hudson-plugins-promoted_builds-JobPropertyImpl</string>
<string>hudson-plugins-disk_usage-DiskUsageProperty</string>
</cascading-job-properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>false</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<concurrentBuild>false</concurrentBuild>
<cleanWorkspaceRequired>false</cleanWorkspaceRequired>
<axes/>
<runSequentially>false</runSequentially>
<configSubmit>false</configSubmit>
</matrix-project>
Loading

0 comments on commit 193cab4

Please sign in to comment.