Add Test Selector Plugin support
Change-Id: If5637bff0ce312946ff1f9e10a6b49e25b9aca8b
This commit is contained in:
parent
b14813ba78
commit
72dd337adb
@ -5329,6 +5329,62 @@ def clamav(parser, xml_parent, data):
|
|||||||
data.get('excludes', ''))
|
data.get('excludes', ''))
|
||||||
|
|
||||||
|
|
||||||
|
def testselector(parser, xml_parent, data):
|
||||||
|
"""yaml: testselector
|
||||||
|
This plugin allows you to choose specific tests you want to run.
|
||||||
|
|
||||||
|
Requires the Jenkins :jenkins-wiki:`Tests Selector Plugin
|
||||||
|
<Tests+Selector+Plugin>`.
|
||||||
|
|
||||||
|
:arg str name: Environment variable in which selected tests are saved
|
||||||
|
(required)
|
||||||
|
:arg str description: Description
|
||||||
|
(default "")
|
||||||
|
:arg str properties-file: Contain all your tests
|
||||||
|
(required)
|
||||||
|
:arg str enable-field: Imply if the test is enabled or not
|
||||||
|
(default "")
|
||||||
|
:arg str groupby: Plugin will group the tests by
|
||||||
|
(default "")
|
||||||
|
:arg str field-sperator: Separate between the fields in the tests tree
|
||||||
|
(default "")
|
||||||
|
:arg str show-fields: Shown in the tests tree
|
||||||
|
(default "")
|
||||||
|
:arg str multiplicity-field: Amount of times the test should run
|
||||||
|
(default "")
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/publishers/fixtures/testselector001.yaml
|
||||||
|
:language: yaml
|
||||||
|
"""
|
||||||
|
|
||||||
|
testselector = XML.SubElement(xml_parent, 'il.ac.technion.jenkins.plugins'
|
||||||
|
'TestExecuter')
|
||||||
|
try:
|
||||||
|
name = str(data['name'])
|
||||||
|
except KeyError as e:
|
||||||
|
raise MissingAttributeError(e.args[0])
|
||||||
|
try:
|
||||||
|
propertiesfile = str(data['properties-file'])
|
||||||
|
except KeyError as e:
|
||||||
|
raise MissingAttributeError(e.args[0])
|
||||||
|
XML.SubElement(testselector, 'name').text = name
|
||||||
|
XML.SubElement(testselector, 'description').text = data.get(
|
||||||
|
'description', '')
|
||||||
|
XML.SubElement(testselector, 'propertiesFilePath').text = propertiesfile
|
||||||
|
XML.SubElement(testselector, 'enableField').text = data.get(
|
||||||
|
'enable-field', '')
|
||||||
|
XML.SubElement(testselector, 'groupBy').text = data.get(
|
||||||
|
'groupby', '')
|
||||||
|
XML.SubElement(testselector, 'fieldSeparator').text = data.get(
|
||||||
|
'field-separator', '')
|
||||||
|
XML.SubElement(testselector, 'showFields').text = data.get(
|
||||||
|
'show-fields', '')
|
||||||
|
XML.SubElement(testselector, 'multiplicityField').text = data.get(
|
||||||
|
'multiplicity-field', '')
|
||||||
|
|
||||||
|
|
||||||
def cloudformation(parser, xml_parent, data):
|
def cloudformation(parser, xml_parent, data):
|
||||||
"""yaml: cloudformation
|
"""yaml: cloudformation
|
||||||
Create cloudformation stacks before running a build and optionally
|
Create cloudformation stacks before running a build and optionally
|
||||||
|
15
tests/publishers/fixtures/testselector001.xml
Normal file
15
tests/publishers/fixtures/testselector001.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<publishers>
|
||||||
|
<il.ac.technion.jenkins.pluginsTestExecuter>
|
||||||
|
<name>tests</name>
|
||||||
|
<description>integration</description>
|
||||||
|
<propertiesFilePath>example.properties</propertiesFilePath>
|
||||||
|
<enableField>enabled</enableField>
|
||||||
|
<groupBy>testgroup</groupBy>
|
||||||
|
<fieldSeparator>.</fieldSeparator>
|
||||||
|
<showFields>testsuite,testcase</showFields>
|
||||||
|
<multiplicityField>multiplicity</multiplicityField>
|
||||||
|
</il.ac.technion.jenkins.pluginsTestExecuter>
|
||||||
|
</publishers>
|
||||||
|
</project>
|
10
tests/publishers/fixtures/testselector001.yaml
Normal file
10
tests/publishers/fixtures/testselector001.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
publishers:
|
||||||
|
- testselector:
|
||||||
|
name: tests
|
||||||
|
description: integration
|
||||||
|
properties-file: example.properties
|
||||||
|
enable-field: enabled
|
||||||
|
groupby: testgroup
|
||||||
|
field-separator: .
|
||||||
|
show-fields: testsuite,testcase
|
||||||
|
multiplicity-field: multiplicity
|
Loading…
x
Reference in New Issue
Block a user