reportportal / agent-Python-RobotFramework

Robot Framework integration for Report Portal
Apache License 2.0
59 stars 32 forks source link

Calling method 'start_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'source' #110

Closed ablatov closed 3 years ago

ablatov commented 3 years ago

Describe the bug 'start_test' method in listener fails because the lack of 'source' field in test attributes.

Steps to Reproduce

  1. Tests folder is the following

tests -robot --tests ---folder1 -----suite1 ---folder2 -----suite2 -----suite3.....

  1. Run command: pabot --verbose --processes 2 --listener robotframework_reportportal.listener --variable RP_UUID:0e23873d-bb4b --variable RP_ENDPOINT:localhost:8080 --variable RP_LAUNCH:PROJECT_DAILY --variable RP_PROJECT:superadmin_personal --variable RP_LAUNCH_UUID:d01aba21-4b45-4065 -V configs/dev.py -d . -i tag1 -i tag2 tests/robot/tests

Expected behavior Test results were pushed to RP

Actual behavior Listener failed to upload with error:

==============================================================================
Tests                                                                 | FAIL |
14 critical tests, 10 passed, 4 failed
14 tests total, 10 passed, 4 failed
==============================================================================
Output:  mypath/pabot_results/1/output.xml

[ ERROR ] Calling method 'start_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'source'
[ ERROR ] Calling method 'end_test' of listener 'robotframework_reportportal.listener' failed: AttributeError: 'Suite' object has no attribute 'tags'
[ ERROR ] Calling method 'start_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'source'
[ ERROR ] Calling method 'end_test' of listener 'robotframework_reportportal.listener' failed: AttributeError: 'Suite' object has no attribute 'tags'
[ ERROR ] Calling method 'start_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'source'
[ ERROR ] Calling method 'end_test' of listener 'robotframework_reportportal.listener' failed: AttributeError: 'Suite' object has no attribute 'tags'
[ ERROR ] Calling method 'start_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'source'
[ ERROR ] Calling method 'end_test' of listener 'robotframework_reportportal.listener' failed: AttributeError: 'Suite' object has no attribute 'tags'
[ ERROR ] Calling method 'start_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'source'
[ ERROR ] Calling method 'start_keyword' of listener 'robotframework_reportportal.listener' failed: AttributeError: 'NoneType' object has no attribute 'type'

Package versions reportportal-client 5.0.10
robotframework-reportportal 5.1.2 robotframework 3.1.2 robotframework-pabot 1.8.0

Additional context Why? Who is responsible to put 'source' field to test attributes? If remove string formating to hardoded everything works fine. Ex from self.code_ref = '{0}:{1}'.format(attributes['source'], name) to self.code_ref = '{0}:{1}'.format('\my\path', name)

ablatov commented 3 years ago

Hi @HardNorth and thank you for such a fast fix! When do you think it is possible to release this fix?

iivanou commented 3 years ago

Fixed in #111.