From fe58d7795fd25430deeda274be37ce694f157ee9 Mon Sep 17 00:00:00 2001 From: natechols Date: Thu, 12 Jul 2018 10:13:07 -0700 Subject: [PATCH 1/2] add option to exclude property-less tests --- pbcommand/testkit/nunit.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pbcommand/testkit/nunit.py b/pbcommand/testkit/nunit.py index fa76331..d45fe78 100755 --- a/pbcommand/testkit/nunit.py +++ b/pbcommand/testkit/nunit.py @@ -96,12 +96,21 @@ def create_nunit_xml(test_cases): return doc -def combine_results(xml_files): +def combine_results(xml_files, only_with_properties=False): + """ + Combine multiple NUnit outputs into a single test suite. + + :param xml_files: list of NUnit input file names + :param only_with_properties: only output test cases that include one or more property tags (for Bamboo reporting) + """ test_cases = [] for xml_file in xml_files: log.info("Reading NUnit report %s", xml_file) dom = minidom.parse(xml_file) for node in dom.getElementsByTagName("test-case"): + if only_with_properties: + if len(node.getElementsByTagName("property")) == 0: + continue test_cases.append(TestCase.from_xml(node)) return create_nunit_xml(test_cases) From b3a4ec9219ae30ed33030ce3bd847f1bc4015a74 Mon Sep 17 00:00:00 2001 From: natechols Date: Thu, 12 Jul 2018 10:15:41 -0700 Subject: [PATCH 2/2] bump version --- pbcommand/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pbcommand/__init__.py b/pbcommand/__init__.py index e1fbe9a..336b261 100644 --- a/pbcommand/__init__.py +++ b/pbcommand/__init__.py @@ -1,4 +1,4 @@ -VERSION = (1, 1, 0) +VERSION = (1, 1, 1) def get_version():