34 | | 4. Add a post-build action to "Publish xUnit test report". |
35 | | [[Image(publish_xUnit_test_result_report.png)]] |
| 39 | == Jenkins config.xml |
| 40 | This is the config.xml from /var/lib/jenkins/jobs/0ad. It should contain all required information to configure Jenkins. |
| 41 | This format should be sufficient as long as the whole setup and the configuration is not final yet. |
| 42 | |
| 43 | {{{ |
| 44 | #!xml |
| 45 | <?xml version='1.0' encoding='UTF-8'?> |
| 46 | <matrix-project> |
| 47 | <actions/> |
| 48 | <description></description> |
| 49 | <keepDependencies>false</keepDependencies> |
| 50 | <properties/> |
| 51 | <scm class="hudson.scm.SubversionSCM" plugin="subversion@1.54"> |
| 52 | <locations> |
| 53 | <hudson.scm.SubversionSCM_-ModuleLocation> |
| 54 | <remote>http://svn.wildfiregames.com/public/ps/trunk</remote> |
| 55 | <local>0ad</local> |
| 56 | <depthOption>infinity</depthOption> |
| 57 | <ignoreExternalsOption>false</ignoreExternalsOption> |
| 58 | </hudson.scm.SubversionSCM_-ModuleLocation> |
| 59 | </locations> |
| 60 | <excludedRegions></excludedRegions> |
| 61 | <includedRegions></includedRegions> |
| 62 | <excludedUsers></excludedUsers> |
| 63 | <excludedRevprop></excludedRevprop> |
| 64 | <excludedCommitMessages></excludedCommitMessages> |
| 65 | <workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/> |
| 66 | <ignoreDirPropChanges>false</ignoreDirPropChanges> |
| 67 | <filterChangelog>false</filterChangelog> |
| 68 | </scm> |
| 69 | <canRoam>true</canRoam> |
| 70 | <disabled>false</disabled> |
| 71 | <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> |
| 72 | <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> |
| 73 | <triggers> |
| 74 | <hudson.triggers.SCMTrigger> |
| 75 | <spec>*/10 * * * *</spec> |
| 76 | <ignorePostCommitHooks>false</ignorePostCommitHooks> |
| 77 | </hudson.triggers.SCMTrigger> |
| 78 | </triggers> |
| 79 | <concurrentBuild>false</concurrentBuild> |
| 80 | <axes> |
| 81 | <hudson.matrix.TextAxis> |
| 82 | <name>releasetype</name> |
| 83 | <values> |
| 84 | <string>debug</string> |
| 85 | <string>release</string> |
| 86 | </values> |
| 87 | </hudson.matrix.TextAxis> |
| 88 | </axes> |
| 89 | <builders> |
| 90 | <hudson.tasks.Shell> |
| 91 | <command>0ad/build/workspaces/update-workspaces.sh -j3 --jenkins-tests --with-system-enet --with-system-nvtt |
| 92 | </command> |
| 93 | </hudson.tasks.Shell> |
| 94 | <hudson.tasks.Shell> |
| 95 | <command>cd 0ad/build/workspaces/gcc |
| 96 | make -j3 config=$releasetype</command> |
| 97 | </hudson.tasks.Shell> |
| 98 | <hudson.tasks.Shell> |
| 99 | <command>#!/bin/bash |
| 100 | cd 0ad/binaries/system |
| 101 | echo "releasetype: $releasetype" |
| 102 | if [ "$releasetype" == "debug" ]; then |
| 103 | ./test_dbg > ../../../cxxtest_result_$releasetype.xml |
| 104 | else |
| 105 | ./test > ../../../cxxtest_result_$releasetype.xml |
| 106 | fi |
| 107 | sed -i 's/date/timestamp/g' ../../../cxxtest_result_$releasetype.xml</command> |
| 108 | </hudson.tasks.Shell> |
| 109 | </builders> |
| 110 | <publishers> |
| 111 | <xunit plugin="xunit@1.84"> |
| 112 | <types> |
| 113 | <JUnitType> |
| 114 | <pattern>cxxtest_result_$releasetype.xml</pattern> |
| 115 | <skipNoTestFiles>false</skipNoTestFiles> |
| 116 | <failIfNotNew>true</failIfNotNew> |
| 117 | <deleteOutputFiles>false</deleteOutputFiles> |
| 118 | <stopProcessingIfError>true</stopProcessingIfError> |
| 119 | </JUnitType> |
| 120 | </types> |
| 121 | <thresholds> |
| 122 | <org.jenkinsci.plugins.xunit.threshold.FailedThreshold> |
| 123 | <unstableThreshold></unstableThreshold> |
| 124 | <unstableNewThreshold></unstableNewThreshold> |
| 125 | <failureThreshold></failureThreshold> |
| 126 | <failureNewThreshold></failureNewThreshold> |
| 127 | </org.jenkinsci.plugins.xunit.threshold.FailedThreshold> |
| 128 | <org.jenkinsci.plugins.xunit.threshold.SkippedThreshold> |
| 129 | <unstableThreshold></unstableThreshold> |
| 130 | <unstableNewThreshold></unstableNewThreshold> |
| 131 | <failureThreshold></failureThreshold> |
| 132 | <failureNewThreshold></failureNewThreshold> |
| 133 | </org.jenkinsci.plugins.xunit.threshold.SkippedThreshold> |
| 134 | </thresholds> |
| 135 | <thresholdMode>1</thresholdMode> |
| 136 | <extraConfiguration> |
| 137 | <testTimeMargin>3000</testTimeMargin> |
| 138 | </extraConfiguration> |
| 139 | </xunit> |
| 140 | </publishers> |
| 141 | <buildWrappers/> |
| 142 | <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> |
| 143 | <runSequentially>false</runSequentially> |
| 144 | </executionStrategy> |
| 145 | </matrix-project> |
| 146 | }}} |