Skip to content

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

@fr33ky

Description

@fr33ky

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions