Add test for name defaults overridden by template
JJB currently allows for named defaults to be specified at both the project and template level. Add a test case that exercises this and demonstrates that current interpolation ignores variables without definitions if they are not subsequently used when expanding the template. Change-Id: Iffdda9f79c12fb71077bf621f8b08381dbcc9ac1
This commit is contained in:
parent
fbd432a0ad
commit
3ae187b1a7
tests/yamlparser/fixtures
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<displayName>experimental foo</displayName>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<canRoam>true</canRoam>
|
||||
<properties/>
|
||||
<scm class="hudson.scm.NullSCM"/>
|
||||
<builders/>
|
||||
<publishers>
|
||||
<hudson.plugins.emailext.ExtendedEmailPublisher>
|
||||
<recipientList>dev@example.com</recipientList>
|
||||
<configuredTriggers>
|
||||
<hudson.plugins.emailext.plugins.trigger.FailureTrigger>
|
||||
<email>
|
||||
<recipientList/>
|
||||
<subject>$PROJECT_DEFAULT_SUBJECT</subject>
|
||||
<body>$PROJECT_DEFAULT_CONTENT</body>
|
||||
<sendToRequester>false</sendToRequester>
|
||||
<sendToDevelopers>false</sendToDevelopers>
|
||||
<includeCulprits>false</includeCulprits>
|
||||
<sendToRecipientList>true</sendToRecipientList>
|
||||
</email>
|
||||
</hudson.plugins.emailext.plugins.trigger.FailureTrigger>
|
||||
</configuredTriggers>
|
||||
<contentType>default</contentType>
|
||||
<defaultSubject>$DEFAULT_SUBJECT</defaultSubject>
|
||||
<defaultContent>$DEFAULT_CONTENT</defaultContent>
|
||||
<attachmentsPattern/>
|
||||
<presendScript/>
|
||||
<attachBuildLog>false</attachBuildLog>
|
||||
<saveOutput>false</saveOutput>
|
||||
<replyTo>$DEFAULT_REPLYTO</replyTo>
|
||||
</hudson.plugins.emailext.ExtendedEmailPublisher>
|
||||
</publishers>
|
||||
<buildWrappers/>
|
||||
</project>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<displayName>production bar</displayName>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<canRoam>true</canRoam>
|
||||
<properties/>
|
||||
<scm class="hudson.scm.NullSCM"/>
|
||||
<builders/>
|
||||
<publishers>
|
||||
<hudson.tasks.Mailer>
|
||||
<recipients>qa@example.com</recipients>
|
||||
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
|
||||
<sendToIndividuals>false</sendToIndividuals>
|
||||
</hudson.tasks.Mailer>
|
||||
</publishers>
|
||||
<buildWrappers/>
|
||||
</project>
|
@ -0,0 +1,33 @@
|
||||
- job-template:
|
||||
name: '{publish}_foo'
|
||||
display-name: '{publish} foo'
|
||||
defaults: testdefaults
|
||||
|
||||
- job-template:
|
||||
name: '{publish}_bar'
|
||||
display-name: '{publish} bar'
|
||||
defaults: testdefaults
|
||||
publishers:
|
||||
- email:
|
||||
recipients: qa@example.com
|
||||
|
||||
- project:
|
||||
name: dev
|
||||
publish: 'experimental'
|
||||
defaults: testdefaults
|
||||
recipients: dev@example.com
|
||||
jobs:
|
||||
- '{publish}_foo'
|
||||
|
||||
- project:
|
||||
name: foobar
|
||||
publish: 'production'
|
||||
defaults: testdefaults
|
||||
jobs:
|
||||
- '{publish}_bar'
|
||||
|
||||
- defaults:
|
||||
name: testdefaults
|
||||
publishers:
|
||||
- email-ext:
|
||||
recipients: '{recipients}'
|
Loading…
Reference in New Issue
Block a user