Skip to content

Commit

Permalink
Parametrization testing with CLOUDTP
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoura committed Jun 20, 2018
1 parent 6c8c7ed commit 34f7bbf
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions dump2polarion/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def requirement_transform(requirement):
PROJECT_MAPPING_XUNIT = {
'RHCF3': get_results_transform_cfme,
'CMP': get_results_transform_cmp,
'CLOUDTP': get_results_transform_cfme,
}


Expand Down
37 changes: 37 additions & 0 deletions tests/data/complete_parametrization.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version='1.0' encoding='utf-8'?>
<testsuites>
<!--Generated for testrun 5_8_0_17-->
<properties>
<property name="polarion-testrun-id" value="5_8_0_17"/>
<property name="polarion-dry-run" value="False"/>
<property name="polarion-project-id" value="CLOUDTP"/>
<property name="polarion-response-test" value="test"/>
<property name="polarion-testrun-status-id" value="inprogress"/>
<property name="polarion-lookup-method" value="name"/>
</properties>
<testsuite name="Import for CLOUDTP - 5_8_0_17 testrun" errors="0" failures="0" skipped="0" time="2459.3562" tests="3">
<testcase name="TestInstanceRESTAPI.test_start" time="627.839309">
<properties>
<property name="polarion-testcase-id" value="TestInstanceRESTAPI.test_start"/>
<property name="polarion-testcase-comment" value="Source: jenkins/downstream-58z-extcloud-tests-master/10"/>
<property name="polarion-parameter-provider" value="azure"/>
<property name="polarion-parameter-from_detail" value="True"/>
</properties>
</testcase>
<testcase name="TestInstanceRESTAPI.test_stop" time="733.560498">
<properties>
<property name="polarion-testcase-id" value="TestInstanceRESTAPI.test_stop"/>
<property name="polarion-testcase-comment" value="Source: jenkins/downstream-58z-extcloud-tests-master/10"/>
<property name="polarion-parameter-provider" value="gce_central"/>
<property name="polarion-parameter-from_detail" value="False"/>
</properties>
</testcase>
<testcase name="test_quadicon_terminate_cancel" time="1097.956355">
<properties>
<property name="polarion-testcase-id" value="test_quadicon_terminate_cancel"/>
<property name="polarion-testcase-comment" value="Source: jenkins/downstream-58z-extcloud-tests-master/10"/>
<property name="polarion-parameter-provider" value="ec2-west"/>
</properties>
</testcase>
</testsuite>
</testsuites>
36 changes: 36 additions & 0 deletions tests/test_parametrization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# encoding: utf-8
# pylint: disable=missing-docstring,no-self-use,too-few-public-methods,redefined-outer-name

from __future__ import unicode_literals

import io
import os

import pytest
from tests import conf

from dump2polarion.importer import do_import
from dump2polarion.xunit_exporter import XunitExport


@pytest.fixture(scope="module")
def records_names():
input_file = os.path.join(conf.DATA_PATH, 'ostriz.json')
return do_import(input_file)


@pytest.fixture(scope='module')
def config_cloudtp(config_prop):
config_prop['xunit_import_properties']['polarion-project-id'] = 'CLOUDTP'
config_prop['cfme_parametrize'] = True
return config_prop


class TestParamE2E(object):
def test_e2e_names_transform(self, config_cloudtp, records_names):
exporter = XunitExport('5_8_0_17', records_names, config_cloudtp)
complete = exporter.export()
fname = 'complete_parametrization.xml'
with io.open(os.path.join(conf.DATA_PATH, fname), encoding='utf-8') as input_xml:
parsed = input_xml.read()
assert complete == parsed

0 comments on commit 34f7bbf

Please sign in to comment.