diff options
author | Darragh Bailey <daragh.bailey@gmail.com> | 2013-12-21 20:58:05 +1100 |
---|---|---|
committer | Darragh Bailey <daragh.bailey@gmail.com> | 2014-01-26 17:02:51 +1100 |
commit | b6784fcf6de57d2c77ce8c79316582845387df05 (patch) | |
tree | e66d7c7948d178b3cb16a9d94fc13b46bcf96318 /tests/yamlparser/fixtures/complete001.xml | |
parent | fedd76678bc9af8e95d53e7d0fd61733090985f0 (diff) | |
download | python-jenkins-job-builder-b6784fcf6de57d2c77ce8c79316582845387df05.tar.gz python-jenkins-job-builder-b6784fcf6de57d2c77ce8c79316582845387df05.tar.xz python-jenkins-job-builder-b6784fcf6de57d2c77ce8c79316582845387df05.zip |
Add tests for YamlParser and patch 2.6 minidom
Test full build job XML produced by the YamlParser object which exposed
differences in how the XML was being written on python 2.6 versus newer
versions of python.
Differences were whitespace only, but made testing and validating the
xml outputted across multiple versions of python difficult.
Code now patches the python 2.6 writexml method on the Element class in
the xml.dom.minidom module, with a version of the method taken from
python 2.7.5.
Removed the now obsolete regex that was reformatting the output on
python 2.6.
Change-Id: I26c100b6adfbcb9b197bb06cd162855adaaf24c5
Diffstat (limited to 'tests/yamlparser/fixtures/complete001.xml')
-rw-r--r-- | tests/yamlparser/fixtures/complete001.xml | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/tests/yamlparser/fixtures/complete001.xml b/tests/yamlparser/fixtures/complete001.xml new file mode 100644 index 00000000..1a00ddfd --- /dev/null +++ b/tests/yamlparser/fixtures/complete001.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="utf-8"?> +<project> + <actions/> + <description><!-- Managed by Jenkins Job Builder --></description> + <keepDependencies>false</keepDependencies> + <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> + <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> + <concurrentBuild>false</concurrentBuild> + <canRoam>true</canRoam> + <properties/> + <scm class="hudson.plugins.git.GitSCM"> + <configVersion>2</configVersion> + <userRemoteConfigs> + <hudson.plugins.git.UserRemoteConfig> + <name>origin</name> + <refspec>+refs/heads/*:refs/remotes/origin/*</refspec> + <url>ssh://jenkins@review.openstack.org:29418/openstack-infra/jenkins-job-builder.git</url> + </hudson.plugins.git.UserRemoteConfig> + </userRemoteConfigs> + <branches> + <hudson.plugins.git.BranchSpec> + <name>origin/**</name> + </hudson.plugins.git.BranchSpec> + </branches> + <excludedUsers/> + <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/> + <disableSubmodules>false</disableSubmodules> + <recursiveSubmodules>false</recursiveSubmodules> + <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> + <authorOrCommitter>false</authorOrCommitter> + <clean>true</clean> + <wipeOutWorkspace>true</wipeOutWorkspace> + <pruneBranches>true</pruneBranches> + <remotePoll>false</remotePoll> + <gitTool>Default</gitTool> + <submoduleCfg class="list"/> + <relativeTargetDir/> + <reference/> + <gitConfigName/> + <gitConfigEmail/> + <skipTag>false</skipTag> + <scmName/> + <useShallowClone>false</useShallowClone> + <browser class="hudson.plugins.git.browser.GitWeb"> + <url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url> + </browser> + </scm> + <triggers class="vector"> + <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger> + <spec/> + <gerritProjects> + <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject> + <compareType>PLAIN</compareType> + <pattern>openstack-infra/jenkins-job-builder</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> + <skipVote> + <onSuccessful>false</onSuccessful> + <onFailed>false</onFailed> + <onUnstable>false</onUnstable> + <onNotBuilt>false</onNotBuilt> + </skipVote> + <silentMode>false</silentMode> + <escapeQuotes>true</escapeQuotes> + <noNameAndEmailParameters>false</noNameAndEmailParameters> + <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration> + <triggerConfigURL/> + <triggerOnEvents> + <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent/> + </triggerOnEvents> + <gerritBuildSuccessfulVerifiedValue>1</gerritBuildSuccessfulVerifiedValue> + <gerritBuildFailedVerifiedValue>-1</gerritBuildFailedVerifiedValue> + <buildStartMessage/> + <buildFailureMessage>This change was unable to be automatically merged with the current state of the repository. Please rebase your change and upload a new patchset.</buildFailureMessage> + <buildSuccessfulMessage/> + <buildUnstableMessage/> + <customUrl/> + </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger> + </triggers> + <builders> + <hudson.tasks.Shell> + <command>#!/usr/bin/env python +# +print("Doing something cool with python") +</command> + </hudson.tasks.Shell> + </builders> + <publishers/> + <buildWrappers> + <hudson.plugins.build__timeout.BuildTimeoutWrapper> + <timeoutMinutes>3</timeoutMinutes> + <failBuild>true</failBuild> + <writingDescription>false</writingDescription> + <timeoutPercentage>150</timeoutPercentage> + <timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault> + <timeoutType>elastic</timeoutType> + </hudson.plugins.build__timeout.BuildTimeoutWrapper> + <org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper> + <buildSteps> + <hudson.tasks.Shell> + <command>#!/bin/bash +echo "Doing somethiung cool" +</command> + </hudson.tasks.Shell> + <hudson.tasks.Shell> + <command>#!/bin/zsh +echo "Doing somethin cool with zsh" +</command> + </hudson.tasks.Shell> + <hudson.tasks.Ant> + <targets>target1 target2</targets> + <antName>default</antName> + </hudson.tasks.Ant> + <EnvInjectBuilder> + <info> + <propertiesFilePath>example.prop</propertiesFilePath> + <propertiesContent>EXAMPLE=foo-bar</propertiesContent> + </info> + </EnvInjectBuilder> + </buildSteps> + </org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper> + <com.michelin.cio.hudson.plugins.copytoslave.CopyToSlaveBuildWrapper> + <includes>file1,file2*.txt</includes> + <excludes>file2bad.txt</excludes> + <flatten>false</flatten> + <includeAntExcludes>false</includeAntExcludes> + <relativeTo>userContent</relativeTo> + <hudsonHomeRelative>false</hudsonHomeRelative> + </com.michelin.cio.hudson.plugins.copytoslave.CopyToSlaveBuildWrapper> + </buildWrappers> +</project> |