Skip to content

Commit

Permalink
Merge pull request #66 in SL/pbcommand from bugfix/SL-3048-nunit-excl…
Browse files Browse the repository at this point in the history
…ude to develop

* commit 'b3a4ec9219ae30ed33030ce3bd847f1bc4015a74':
  bump version
  add option to exclude property-less tests
  • Loading branch information
Nathaniel Echols committed Jul 12, 2018
2 parents ca35cda + b3a4ec9 commit a320fe0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pbcommand/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = (1, 1, 0)
VERSION = (1, 1, 1)


def get_version():
Expand Down
11 changes: 10 additions & 1 deletion pbcommand/testkit/nunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a320fe0

Please sign in to comment.