diff options
Diffstat (limited to 'tests/yamlparser')
-rw-r--r-- | tests/yamlparser/fixtures/complete001.xml | 15 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/hipchat1.plugins_info.yaml | 3 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/hipchat1.xml | 27 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/hipchat1.yaml | 17 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/include-raw001.xml | 14 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/include001.xml | 14 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/jinja-string01.xml | 23 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/jinja-string01.yaml | 19 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/lazy-load-jobs-multi001.xml | 14 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/lazy-load-jobs001.xml | 14 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/lazy-load-jobs002.xml | 14 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/variable_escaping.xml | 23 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/variable_escaping.yaml | 17 | ||||
-rw-r--r-- | tests/yamlparser/fixtures/yaml_anchor.xml | 12 |
14 files changed, 184 insertions, 42 deletions
diff --git a/tests/yamlparser/fixtures/complete001.xml b/tests/yamlparser/fixtures/complete001.xml index 40fee172..546fd5e6 100644 --- a/tests/yamlparser/fixtures/complete001.xml +++ b/tests/yamlparser/fixtures/complete001.xml @@ -75,6 +75,7 @@ <notificationLevel/> <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration> <triggerConfigURL/> + <triggerInformationAction/> <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches> <triggerOnEvents> <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent/> @@ -113,12 +114,14 @@ print("Doing something cool with python") <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> + <strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy"> + <timeoutPercentage>150</timeoutPercentage> + <numberOfBuilds>0</numberOfBuilds> + <timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault> + </strategy> + <operationList> + <hudson.plugins.build__timeout.operations.FailOperation/> + </operationList> </hudson.plugins.build__timeout.BuildTimeoutWrapper> <org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper> <buildSteps> diff --git a/tests/yamlparser/fixtures/hipchat1.plugins_info.yaml b/tests/yamlparser/fixtures/hipchat1.plugins_info.yaml new file mode 100644 index 00000000..25ec76fa --- /dev/null +++ b/tests/yamlparser/fixtures/hipchat1.plugins_info.yaml @@ -0,0 +1,3 @@ +- longName: 'Jenkins HipChat Plugin' + shortName: 'hipchat' + version: "2.1.1" diff --git a/tests/yamlparser/fixtures/hipchat1.xml b/tests/yamlparser/fixtures/hipchat1.xml new file mode 100644 index 00000000..e5ec0d31 --- /dev/null +++ b/tests/yamlparser/fixtures/hipchat1.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<project> + <actions/> + <description>desc<!-- 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.scm.NullSCM"/> + <builders/> + <publishers> + <jenkins.plugins.hipchat.HipChatNotifier> + <token/> + <room>room1</room> + <startNotification>true</startNotification> + <notifySuccess>false</notifySuccess> + <notifyAborted>false</notifyAborted> + <notifyNotBuilt>false</notifyNotBuilt> + <notifyUnstable>false</notifyUnstable> + <notifyFailure>false</notifyFailure> + <notifyBackToNormal>false</notifyBackToNormal> + </jenkins.plugins.hipchat.HipChatNotifier> + </publishers> + <buildWrappers/> +</project> diff --git a/tests/yamlparser/fixtures/hipchat1.yaml b/tests/yamlparser/fixtures/hipchat1.yaml new file mode 100644 index 00000000..7a797fc2 --- /dev/null +++ b/tests/yamlparser/fixtures/hipchat1.yaml @@ -0,0 +1,17 @@ +- defaults: + name: global + project-type: freestyle + description: desc + +- project: + name: hipchat1 + jobs: + - 'hipchat1-tpl' + +- job-template: + name: 'hipchat1-tpl' + scm: [] + hipchat: + enabled: true + rooms: [room1] + notify-start: true diff --git a/tests/yamlparser/fixtures/include-raw001.xml b/tests/yamlparser/fixtures/include-raw001.xml index 494410c5..7ec205f1 100644 --- a/tests/yamlparser/fixtures/include-raw001.xml +++ b/tests/yamlparser/fixtures/include-raw001.xml @@ -23,12 +23,14 @@ <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> + <strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy"> + <timeoutPercentage>150</timeoutPercentage> + <numberOfBuilds>0</numberOfBuilds> + <timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault> + </strategy> + <operationList> + <hudson.plugins.build__timeout.operations.FailOperation/> + </operationList> </hudson.plugins.build__timeout.BuildTimeoutWrapper> <org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper> <buildSteps> diff --git a/tests/yamlparser/fixtures/include001.xml b/tests/yamlparser/fixtures/include001.xml index 640c3edb..ec833ab2 100644 --- a/tests/yamlparser/fixtures/include001.xml +++ b/tests/yamlparser/fixtures/include001.xml @@ -23,12 +23,14 @@ <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> + <strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy"> + <timeoutPercentage>150</timeoutPercentage> + <numberOfBuilds>0</numberOfBuilds> + <timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault> + </strategy> + <operationList> + <hudson.plugins.build__timeout.operations.FailOperation/> + </operationList> </hudson.plugins.build__timeout.BuildTimeoutWrapper> <org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper> <buildSteps> diff --git a/tests/yamlparser/fixtures/jinja-string01.xml b/tests/yamlparser/fixtures/jinja-string01.xml new file mode 100644 index 00000000..de5ed018 --- /dev/null +++ b/tests/yamlparser/fixtures/jinja-string01.xml @@ -0,0 +1,23 @@ +<?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.scm.NullSCM"/> + <builders> + <hudson.tasks.Shell> + <command>test variable +a +b +c +</command> + </hudson.tasks.Shell> + </builders> + <publishers/> + <buildWrappers/> +</project> diff --git a/tests/yamlparser/fixtures/jinja-string01.yaml b/tests/yamlparser/fixtures/jinja-string01.yaml new file mode 100644 index 00000000..70e64238 --- /dev/null +++ b/tests/yamlparser/fixtures/jinja-string01.yaml @@ -0,0 +1,19 @@ +- builder: + name: test-builder + builders: + - shell: + !j2: | + {{ var }} + {% for item in test_list -%} + {{ item }} + {% endfor %} + +- job: + name: test-job + builders: + - test-builder: + var: "test variable" + test_list: + - a + - b + - c diff --git a/tests/yamlparser/fixtures/lazy-load-jobs-multi001.xml b/tests/yamlparser/fixtures/lazy-load-jobs-multi001.xml index 2df35f29..4d0d39bf 100644 --- a/tests/yamlparser/fixtures/lazy-load-jobs-multi001.xml +++ b/tests/yamlparser/fixtures/lazy-load-jobs-multi001.xml @@ -33,12 +33,14 @@ echo "Doing somethiung cool" <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> + <strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy"> + <timeoutPercentage>150</timeoutPercentage> + <numberOfBuilds>0</numberOfBuilds> + <timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault> + </strategy> + <operationList> + <hudson.plugins.build__timeout.operations.FailOperation/> + </operationList> </hudson.plugins.build__timeout.BuildTimeoutWrapper> </buildWrappers> </project> diff --git a/tests/yamlparser/fixtures/lazy-load-jobs001.xml b/tests/yamlparser/fixtures/lazy-load-jobs001.xml index 62a32bfe..bc6d7aeb 100644 --- a/tests/yamlparser/fixtures/lazy-load-jobs001.xml +++ b/tests/yamlparser/fixtures/lazy-load-jobs001.xml @@ -30,12 +30,14 @@ VERSION="1.1" <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> + <strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy"> + <timeoutPercentage>150</timeoutPercentage> + <numberOfBuilds>0</numberOfBuilds> + <timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault> + </strategy> + <operationList> + <hudson.plugins.build__timeout.operations.FailOperation/> + </operationList> </hudson.plugins.build__timeout.BuildTimeoutWrapper> </buildWrappers> </project> diff --git a/tests/yamlparser/fixtures/lazy-load-jobs002.xml b/tests/yamlparser/fixtures/lazy-load-jobs002.xml index 446e1dc1..b44a0154 100644 --- a/tests/yamlparser/fixtures/lazy-load-jobs002.xml +++ b/tests/yamlparser/fixtures/lazy-load-jobs002.xml @@ -30,12 +30,14 @@ VERSION="1.2" <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> + <strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy"> + <timeoutPercentage>150</timeoutPercentage> + <numberOfBuilds>0</numberOfBuilds> + <timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault> + </strategy> + <operationList> + <hudson.plugins.build__timeout.operations.FailOperation/> + </operationList> </hudson.plugins.build__timeout.BuildTimeoutWrapper> <org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper> <buildSteps> diff --git a/tests/yamlparser/fixtures/variable_escaping.xml b/tests/yamlparser/fixtures/variable_escaping.xml new file mode 100644 index 00000000..16a37dd2 --- /dev/null +++ b/tests/yamlparser/fixtures/variable_escaping.xml @@ -0,0 +1,23 @@ +<?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.scm.NullSCM"/> + <builders> + <hudson.tasks.Shell> + <command>echo "{var}" +echo "{defined_var|def}" +echo "{undefined_var|def}" +echo "{undefined_var|defined_var}" +</command> + </hudson.tasks.Shell> + </builders> + <publishers/> + <buildWrappers/> +</project> diff --git a/tests/yamlparser/fixtures/variable_escaping.yaml b/tests/yamlparser/fixtures/variable_escaping.yaml new file mode 100644 index 00000000..44e8f7b4 --- /dev/null +++ b/tests/yamlparser/fixtures/variable_escaping.yaml @@ -0,0 +1,17 @@ +- project: + name: test_template_variable_escaping + jobs: + - 'template_variable_escaping': + defined_var: 'Hello' + +- job-template: + name: 'template_variable_escaping' + builders: + - shell: | + echo "{{var}}" + echo "{{defined_var|def}}" + echo "{{undefined_var|def}}" + echo "{{undefined_var|defined_var}}" + + + diff --git a/tests/yamlparser/fixtures/yaml_anchor.xml b/tests/yamlparser/fixtures/yaml_anchor.xml index 65868964..9d18713d 100644 --- a/tests/yamlparser/fixtures/yaml_anchor.xml +++ b/tests/yamlparser/fixtures/yaml_anchor.xml @@ -13,12 +13,12 @@ <publishers/> <buildWrappers> <hudson.plugins.build__timeout.BuildTimeoutWrapper> - <timeoutMinutes>180</timeoutMinutes> - <failBuild>true</failBuild> - <writingDescription>false</writingDescription> - <timeoutPercentage>0</timeoutPercentage> - <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault> - <timeoutType>absolute</timeoutType> + <strategy class="hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy"> + <timeoutMinutes>180</timeoutMinutes> + </strategy> + <operationList> + <hudson.plugins.build__timeout.operations.FailOperation/> + </operationList> </hudson.plugins.build__timeout.BuildTimeoutWrapper> <hudson.plugins.timestamper.TimestamperBuildWrapper/> </buildWrappers> |