reportportal / agent-Python-RobotFramework

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

Listner not working #66

Closed raggs07 closed 4 years ago

raggs07 commented 4 years ago

Moment I start the test, it keeps printing this message in loop. Not sure what is causing the issue or what I am doing wrong.

Version Info: reportportal-client 5.0.3 robotframework 2.8.4 robotframework-reportportal 5.0.2 Report Portal Version: 5.2.3

[ ERROR ] Calling listener method 'start_suite' of listener 'robotframework_reportportal.listener' failed: KeyError: 'id' [ ERROR ] Calling listener method 'start_keyword' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'start_keyword' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'end_keyword' of listener 'robotframework_reportportal.listener' failed: KeyError: 'libname' [ ERROR ] Calling listener method 'start_keyword' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range

iivanou commented 4 years ago

@raggs07 Are sure that you passed all the necessary RP connection parameters via the command-line correctly?

raggs07 commented 4 years ago

yes passed all the Required parameters: --listener robotframework_reportportal.listener --variable RP_UUID:"your_user_uuid" --variable RP_ENDPOINT:"your_reportportal_url" --variable RP_LAUNCH:"launch_name" --variable RP_PROJECT:"reportportal_project_name"

This first time I am using reportPortal. So no prior installation was there.

iivanou commented 4 years ago

Please, double-check your input parameters. Everything works well on my side.

raggs07 commented 4 years ago

i dont think this is due to input parameter I removed the RP_PROJECT variable and fired the commands still got the same errors. I believe the main problem is at not getting the Suite ID, not sure why... because of that all of these errors are coming.

iivanou commented 4 years ago

I need something that helps me to reproduce the problem on my side. Could you create and share a test suite that I can use?

raggs07 commented 4 years ago

This what i ran: pybot --listener robotframework_reportportal.listener --variable RP_UUID="" --variable RP_ENDPOINT="http://localhost:8080" --variable RP_LAUNCH="Testing" --variable RP_PROJECT="superadmin_personal" test1.txt

test1.txt:

Test Cases TC1 Log Hello World


Give me a pointer on possible reasons for Suite ID not getting in attributes. I will try to debug it here.

raggs07 commented 4 years ago

Output from above command :

============================================================================== Test1

[ ERROR ] Calling listener method 'start_suite' of listener 'robotframework_reportportal.listener' failed: KeyError: 'id' [ ERROR ] Calling listener method 'start_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'id' [ ERROR ] Calling listener method 'start_keyword' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'log_message' of listener 'robotframework_reportportal.listener' failed: IndexError: list index out of range [ ERROR ] Calling listener method 'end_keyword' of listener 'robotframework_reportportal.listener' failed: KeyError: 'libname' TC1 | PASS |

[ ERROR ] Calling listener method 'end_test' of listener 'robotframework_reportportal.listener' failed: KeyError: 'id' Test1 | PASS | 1 critical test, 1 passed, 0 failed 1 test total, 1 passed, 0 failed

[ ERROR ] Calling listener method 'end_suite' of listener 'robotframework_reportportal.listener' failed: KeyError: 'id'

iivanou commented 4 years ago

@raggs07 RP_UUID should not be empty.

Your example works well on my side:

# robot --listener robotframework_reportportal.listener --variable RP_UUID:"6fecfbb1-xxx-xxxx-xxxx-xxxxxxxxxxx" --variable RP_ENDPOINT:"https://beta.demo.reportportal.io" --variable RP_LAUNCH:"test_key_error" --variable RP_PROJECT:"iivanou_personal" test1.txt
[ WARN ] Automatically parsing other than '*.robot' files is deprecated. Convert '/***/agent-Python-RobotFramework/test1.txt' to '*.robot' format or use '--extension' to explicitly configure which files to parse.
==============================================================================
Test1                                                                         
==============================================================================
TC1                                                                   Hello World
TC1                                                                   | PASS |
------------------------------------------------------------------------------
Test1                                                                 | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
raggs07 commented 4 years ago

i printed the attribute in listner.py this what I got:

{'suites': [], 'tests': [u'TC1'], 'doc': u'', 'source': u'/home/**/test1.txt', 'totaltests': 1, 'starttime': '20200727 05:41:00.216', 'longname': u'Test1', 'metadata': {}}

iivanou commented 4 years ago
[ WARN ] Automatically parsing other than '*.robot' files is deprecated. Convert '/***/agent-Python-RobotFramework/test1.txt' to '*.robot' format or use '--extension' to explicitly configure which files to parse.
==============================================================================
Test1                                                                         
==============================================================================
{'id': 's1', 'longname': 'Test1', 'doc': '', 'metadata': {}, 'starttime': '20200727 16:00:36.394', 'tests': ['TC1'], 'suites': [], 'totaltests': 1, 'source': '/***/agent-Python-RobotFramework/test1.txt'}
{'id': 's1-s1', 'longname': 'Test1', 'doc': '', 'metadata': {}, 'starttime': '20200727 16:00:36.394', 'tests': ['TC1'], 'suites': [], 'totaltests': 1, 'source': '/***/agent-Python-RobotFramework/test1.txt'}
TC1                                                                   Hello World
TC1                                                                   | PASS |
------------------------------------------------------------------------------
Test1                                                                 | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
# robot --version
Robot Framework 3.1.2 (Python 3.6.5 on linux)
raggs07 commented 4 years ago

i see your robot version is 3.1.2 can it be because of that my pybot version :
pybot --version Robot Framework 2.8.4 (Python 2.7.5 on linux2)

raggs07 commented 4 years ago

I just created a robot 3 client and ran it over there and it worked but for robot 2 it do not work... so it is clear that robot 2 support is required, which version of library I can use for robot 2

iivanou commented 4 years ago

Robot versions below 3 support Python 2 only. It does not make any sense adding support for Python 2 because it is EOL. You can try juggling with agent versions, but I'm doubt that you will find any version that supports both a new common Python client version 5 and robot versions below 3. Nevertheless, you can contribute to the project in order to achieve that goal.