Convert jclouds example to unit test
Change-Id: Ic24dc65c6bc2785bc81b6769e57b5391700dfb0f
This commit is contained in:
parent
4345c9dc9b
commit
4e4aeb7564
@ -854,20 +854,11 @@ def jclouds(parser, xml_parent, data):
|
|||||||
:arg bool stop-on-terminate: Whether or not to suspend instead of terminate
|
:arg bool stop-on-terminate: Whether or not to suspend instead of terminate
|
||||||
the instance (default: False).
|
the instance (default: False).
|
||||||
|
|
||||||
Example::
|
Example:
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/wrappers/fixtures/jclouds001.yaml
|
||||||
|
:language: yaml
|
||||||
|
|
||||||
wrappers:
|
|
||||||
- jclouds:
|
|
||||||
single-use: True
|
|
||||||
instances:
|
|
||||||
- jenkins-dev-slave:
|
|
||||||
cloud-name: mycloud1
|
|
||||||
count: 1
|
|
||||||
stop-on-terminate: True
|
|
||||||
- jenkins-test-slave:
|
|
||||||
cloud-name: mycloud2
|
|
||||||
count: 2
|
|
||||||
stop-on-terminate: False
|
|
||||||
"""
|
"""
|
||||||
buildWrapper = XML.SubElement(xml_parent,
|
buildWrapper = XML.SubElement(xml_parent,
|
||||||
'jenkins.plugins.jclouds.compute.'
|
'jenkins.plugins.jclouds.compute.'
|
||||||
|
22
tests/wrappers/fixtures/jclouds001.xml
Normal file
22
tests/wrappers/fixtures/jclouds001.xml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<buildWrappers>
|
||||||
|
<jenkins.plugins.jclouds.compute.JCloudsBuildWrapper>
|
||||||
|
<instancesToRun>
|
||||||
|
<jenkins.plugins.jclouds.compute.InstancesToRun>
|
||||||
|
<templateName>jenkins-dev-slave</templateName>
|
||||||
|
<cloudName>mycloud1</cloudName>
|
||||||
|
<count>1</count>
|
||||||
|
<suspendOrTerminate>true</suspendOrTerminate>
|
||||||
|
</jenkins.plugins.jclouds.compute.InstancesToRun>
|
||||||
|
<jenkins.plugins.jclouds.compute.InstancesToRun>
|
||||||
|
<templateName>jenkins-test-slave</templateName>
|
||||||
|
<cloudName>mycloud2</cloudName>
|
||||||
|
<count>2</count>
|
||||||
|
<suspendOrTerminate>false</suspendOrTerminate>
|
||||||
|
</jenkins.plugins.jclouds.compute.InstancesToRun>
|
||||||
|
</instancesToRun>
|
||||||
|
</jenkins.plugins.jclouds.compute.JCloudsBuildWrapper>
|
||||||
|
<jenkins.plugins.jclouds.compute.JCloudsOneOffSlave/>
|
||||||
|
</buildWrappers>
|
||||||
|
</project>
|
12
tests/wrappers/fixtures/jclouds001.yaml
Normal file
12
tests/wrappers/fixtures/jclouds001.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
wrappers:
|
||||||
|
- jclouds:
|
||||||
|
single-use: True
|
||||||
|
instances:
|
||||||
|
- jenkins-dev-slave:
|
||||||
|
cloud-name: mycloud1
|
||||||
|
count: 1
|
||||||
|
stop-on-terminate: True
|
||||||
|
- jenkins-test-slave:
|
||||||
|
cloud-name: mycloud2
|
||||||
|
count: 2
|
||||||
|
stop-on-terminate: False
|
Loading…
x
Reference in New Issue
Block a user