Skip to content

Commit

Permalink
Merge df179f7 into 1c5c741
Browse files Browse the repository at this point in the history
  • Loading branch information
pyup-bot committed Jan 11, 2021
2 parents 1c5c741 + df179f7 commit ef3da19
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ env:
- MAKE=ci
- MAKE=check-build
install:
- pip install -r devel.txt
- pip install -U pip
- pip install -U -r devel.txt
script:
- make $MAKE

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
junitparser==1.6.3
junitparser==2.0.0
tcms-api==8.6.0
37 changes: 24 additions & 13 deletions tcms_junit_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019 Alexander Todorov <atodorov@MrSenko.com>
# Copyright (c) 2019-2021 Alexander Todorov <atodorov@MrSenko.com>

# Licensed under the GPLv3: https://www.gnu.org/licenses/gpl.html

Expand Down Expand Up @@ -39,20 +39,31 @@ def parse(self, junit_xml, progress_cb=None):
self.backend.run_id)
comment = 'Result recorded via Kiwi TCMS junit.xml-plugin'

if xml_case.result is None:
status_id = self.backend.get_status_id('PASSED')

if isinstance(xml_case.result, Failure):
status_id = self.backend.get_status_id('FAILED')
comment = xml_case.result.tostring()
print("**** DEBUG: ", summary, "result=", xml_case.result)

if isinstance(xml_case.result, Error):
status_id = self.backend.get_status_id('ERROR')
comment = xml_case.result.tostring()
if xml_case.result is []:
print("**** will pass")
status_id = self.backend.get_status_id('PASSED')

if isinstance(xml_case.result, Skipped):
status_id = self.backend.get_status_id('WAIVED')
comment = xml_case.result.message
# note: since junitpartser v2.0 the result attribute holds
# a list of values b/c pytest can produce files which contain
# multiple results for the same test case. We take the first!
for result in xml_case.result:
print("***** looping for ", summary, "result=", result)
if isinstance(result, Failure):
status_id = self.backend.get_status_id('FAILED')
comment = result.tostring()
break

if isinstance(result, Error):
status_id = self.backend.get_status_id('ERROR')
comment = result.tostring()
break

if isinstance(result, Skipped):
status_id = self.backend.get_status_id('WAIVED')
comment = result.message
break

self.backend.update_test_execution(test_execution_id,
status_id,
Expand Down

0 comments on commit ef3da19

Please sign in to comment.