Changes between Version 3 and Version 4 of JenkinsSetup


Ignore:
Timestamp:
Apr 26, 2014, 12:38:46 AM (10 years ago)
Author:
Yves
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • JenkinsSetup

    v3 v4  
    1212
    1313
     14= Configuration
     15I'm still testing different settings and configurations, but the settings listed at the end of this page should be a good base to get a working Jenkins setup.
     16It basically polls SVN for changes, then does svn update, runs update-workspaces.sh and make.
     17After that it executes the unit tests and checks if they all pass. This procedure is done for a debug and a release configuration.
     18
    1419== Unit test configuration
    1520You can configure Jenkins to run our unit tests and report the results on the web interface.
     
    18231. Install the xUnit plugin
    19241. In the project configuration, make sure to pass the argument --jenkins-tests to update-workspaces.sh
    20 1. in the execute shell section, add the following script to run the tests. It also contains a small fix for an incompatibility with the xUnit format used by Jenkins.
    21 
     251. In the execute shell section, add this script for running the tests. It also contains a small fix for an incompatibility with the xUnit format used by Jenkins.
    2226{{{
    2327#!/bin/bash
     
    2731    ./test_dbg > ../../../cxxtest_result_$releasetype.xml
    2832else
    29     -/test > ../../../cxxtest_result_$releasetype.xml
     33    ./test > ../../../cxxtest_result_$releasetype.xml
    3034fi
    3135sed -i 's/date/timestamp/g' ../../../cxxtest_result_$releasetype.xml
    3236}}}
     374. Add a post-build action to "Publish xUnit test report" as described in the configuration section.
    3338
    34 4. Add a post-build action to "Publish xUnit test report".
    35 [[Image(publish_xUnit_test_result_report.png)]]
     39== Jenkins config.xml
     40This is the config.xml from /var/lib/jenkins/jobs/0ad. It should contain all required information to configure Jenkins.
     41This 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
     96make -j3 config=$releasetype</command>
     97    </hudson.tasks.Shell>
     98    <hudson.tasks.Shell>
     99      <command>#!/bin/bash
     100cd 0ad/binaries/system
     101echo &quot;releasetype: $releasetype&quot;
     102if [ &quot;$releasetype&quot; == &quot;debug&quot; ]; then
     103  ./test_dbg &gt; ../../../cxxtest_result_$releasetype.xml
     104else
     105  ./test &gt; ../../../cxxtest_result_$releasetype.xml
     106fi
     107sed -i &apos;s/date/timestamp/g&apos; ../../../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}}}