Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(worker_outcome=exception + test_outcome=incompetent) has no diff, leading to traceback in cr-xml #453

Open
fr33ky opened this issue Aug 20, 2019 · 1 comment

Comments

@fr33ky
Copy link
Contributor

fr33ky commented Aug 20, 2019

Working on cr-xml from cosmic-ray 5.5.0, I noticed the following error:

Traceback (most recent call last):
  File "/home/fr33ky/.local/bin/cr-xml", line 10, in <module>
    sys.exit(report_xml())
  File "/home/fr33ky/.local/lib/python3.7/site-packages/cosmic_ray/tools/xml.py", line 21, in report_xml
    xml_elem = _create_xml_report(db)
  File "/home/fr33ky/.local/lib/python3.7/site-packages/cosmic_ray/tools/xml.py", line 43, in _create_xml_report
    subelement = _update_element_with_result(subelement, result)
  File "/home/fr33ky/.local/lib/python3.7/site-packages/cosmic_ray/tools/xml.py", line 74, in _update_element_with_result
    error_elem.text = str(data) + "\n".join(result.diff)
TypeError: can only join an iterable

Checking sources I noticed that, in src/cosmic_ray/worker.py, from line 77, a WorkResult is returned with no diff set.

There are then 3 solutions:

  • set diff in worker.py even for exception
  • check if diff is not null in src/cosmic_ray/tools/xml.py (_update_element_with_result)
  • both
@fr33ky fr33ky changed the title (worker_outcome=exception + test_outcome=incompetent) has no diff, leading to traceback in c-xml (worker_outcome=exception + test_outcome=incompetent) has no diff, leading to traceback in cr-xml Aug 20, 2019
@abingham
Copy link
Contributor

Thanks for pointing this out. I think your second solution is the right way to go (i.e. check the diff for None).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants