Add support for 'Micro Focus Application Automation Tools'
Change-Id: Ie514614889daeccbd15b5b2cfffc6157c272849e
This commit is contained in:
parent
e394ed37e0
commit
dfbcbb2510
@ -1397,6 +1397,76 @@ def rocket(registry, xml_parent, data):
|
||||
data.get('custom-message', '')
|
||||
|
||||
|
||||
def hp_alm(registry, xml_parent, data):
|
||||
"""yaml: hp-alm
|
||||
Publish test results to HP-ALM.
|
||||
|
||||
Requires the Jenkins :jenkins-wiki:`Micro Focus Application Automation
|
||||
Tools <Micro+Focus+Application+Automation+Tools)>`.
|
||||
|
||||
:arg str server-name: The name of the ALM Server. (required)
|
||||
:arg str credentials-id: credentials-id of the user (default '')
|
||||
:arg str domaine: The Domain of the project to be used. (required)
|
||||
:arg str client-type: Client type is required for some ALM above 12.60
|
||||
in authentication.(default '')
|
||||
:arg str project: The project to be used. (required)
|
||||
:arg str testing-framework: The testing framework that is used when
|
||||
generate the testing result file. (default Junit)
|
||||
:arg str testing-tool: The testing tool that is used when generate
|
||||
the testing result file. (default '')
|
||||
:arg str folder: The path of the test folder that will contain
|
||||
the uploaded test.
|
||||
The path doesn't include the Root test folder (Subject).
|
||||
For example, sampletestfolder/subfolder means, the tests will be
|
||||
uploaded to test folder named 'subfolder', which is under
|
||||
the test folder named 'sampletestfolder', and 'sampletestfolder'
|
||||
is under the root test folder 'Subject'. (required)
|
||||
:arg str set-folder: The path of the testset folder that will contain
|
||||
the uploaded testset. The path doesn't include the Root testset folder.
|
||||
For example, sampletestsetfolder/subfolder means, the testsets will be
|
||||
uploaded to testset folder named 'subfolder', which is under
|
||||
the testset folder named 'sampletestsetfolder',
|
||||
and 'sampletestsetfolder' is under the root testset folder 'Root'.
|
||||
(required)
|
||||
:arg str testing-result-file: The condition to find the testing
|
||||
result file, start from the root path of the job.
|
||||
For example, ``**/junitResult.xml`` to find testing result file
|
||||
for Junit Plugin, ``**/testng-results.xml`` to find
|
||||
testing result file for TestNG plugin. (required)
|
||||
:arg str jenkins-server-url: The HTTP URL of the Jenkins Server,
|
||||
form example, http://myjenkinsserver.test.com:8080 . (optional)
|
||||
|
||||
Minimal example using defaults:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/hp-alm001.yaml
|
||||
:language: yaml
|
||||
|
||||
Full example:
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/hp-alm002.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
alm_uploader = XML.SubElement(xml_parent,
|
||||
'com.microfocus.application.automation.'
|
||||
'tools.results.TestResultToALMUploader')
|
||||
alm_uploader.set('plugin', 'hp-application-automation-tools-plugin')
|
||||
mapping = [
|
||||
('server-name', 'almServerName', None),
|
||||
('credentials-id', 'credentialsId', ''),
|
||||
('domain', 'almDomain', None),
|
||||
('project', 'almProject', None),
|
||||
('client-type', 'clientType', ''),
|
||||
('testing-framework', 'testingFramework', 'JUnit'),
|
||||
('testing-tool', 'testingTool', ''),
|
||||
('folder', 'almTestFolder', None),
|
||||
('set-folder', 'almTestSetFolder', None),
|
||||
('testing-result-file', 'testingResultFile', None),
|
||||
('jenkins-server-url', 'jenkinsServerUrl', ''),
|
||||
]
|
||||
helpers.convert_mapping_to_xml(
|
||||
alm_uploader, data, mapping, fail_required=True)
|
||||
|
||||
|
||||
def junit(registry, xml_parent, data):
|
||||
"""yaml: junit
|
||||
Publish JUnit test results.
|
||||
|
18
tests/publishers/fixtures/hp-alm001.xml
Normal file
18
tests/publishers/fixtures/hp-alm001.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<com.microfocus.application.automation.tools.results.TestResultToALMUploader plugin="hp-application-automation-tools-plugin">
|
||||
<almServerName>HP-ALM</almServerName>
|
||||
<credentialsId/>
|
||||
<almDomain>FOO_COMPANY</almDomain>
|
||||
<almProject>foo_project</almProject>
|
||||
<clientType/>
|
||||
<testingFramework>JUnit</testingFramework>
|
||||
<testingTool/>
|
||||
<almTestFolder>ALM/foo/release1/test_case1</almTestFolder>
|
||||
<almTestSetFolder>ALM/foo/release1/test_case1/$env</almTestSetFolder>
|
||||
<testingResultFile>**/junitResult.xml</testingResultFile>
|
||||
<jenkinsServerUrl/>
|
||||
</com.microfocus.application.automation.tools.results.TestResultToALMUploader>
|
||||
</publishers>
|
||||
</project>
|
8
tests/publishers/fixtures/hp-alm001.yaml
Normal file
8
tests/publishers/fixtures/hp-alm001.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
publishers:
|
||||
- hp-alm:
|
||||
server-name: HP-ALM
|
||||
domain: FOO_COMPANY
|
||||
project: foo_project
|
||||
folder: 'ALM/foo/release1/test_case1'
|
||||
set-folder: 'ALM/foo/release1/test_case1/$env'
|
||||
testing-result-file: '**/junitResult.xml'
|
18
tests/publishers/fixtures/hp-alm002.xml
Normal file
18
tests/publishers/fixtures/hp-alm002.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<com.microfocus.application.automation.tools.results.TestResultToALMUploader plugin="hp-application-automation-tools-plugin">
|
||||
<almServerName>HP-ALM</almServerName>
|
||||
<credentialsId>cba09876-4321-4567-890a-bcde12345678</credentialsId>
|
||||
<almDomain>FOO_COMPANY</almDomain>
|
||||
<almProject>foo_project</almProject>
|
||||
<clientType>foo_client</clientType>
|
||||
<testingFramework>JUnit</testingFramework>
|
||||
<testingTool>foo_tool</testingTool>
|
||||
<almTestFolder>ALM/foo/release1/test_case1</almTestFolder>
|
||||
<almTestSetFolder>ALM/foo/release1/test_case1/$env</almTestSetFolder>
|
||||
<testingResultFile>**/junitResult.xml</testingResultFile>
|
||||
<jenkinsServerUrl>http://myjenkinsserver.test.com:8080</jenkinsServerUrl>
|
||||
</com.microfocus.application.automation.tools.results.TestResultToALMUploader>
|
||||
</publishers>
|
||||
</project>
|
13
tests/publishers/fixtures/hp-alm002.yaml
Normal file
13
tests/publishers/fixtures/hp-alm002.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
publishers:
|
||||
- hp-alm:
|
||||
server-name: HP-ALM
|
||||
credentials-id: cba09876-4321-4567-890a-bcde12345678
|
||||
domain: FOO_COMPANY
|
||||
project: foo_project
|
||||
client-type: foo_client
|
||||
testing-framework: JUnit
|
||||
testing-tool: foo_tool
|
||||
folder: 'ALM/foo/release1/test_case1'
|
||||
set-folder: 'ALM/foo/release1/test_case1/$env'
|
||||
testing-result-file: '**/junitResult.xml'
|
||||
jenkins-server-url: 'http://myjenkinsserver.test.com:8080'
|
Loading…
Reference in New Issue
Block a user