reportportal / agent-Python-RobotFramework

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

Importing listener 'robotframework_reportportal.listener' failed: ImportError: cannot import name FinishExecutionRQ #10

Closed Tset-Noitamotua closed 7 years ago

Tset-Noitamotua commented 7 years ago

I am trying to run a simple robot test but get this error

[ ERROR ]
Taking listener 'robotframework_reportportal.listener' into use failed:
Importing listener 'robotframework_reportportal.listener' failed:
ImportError: cannot import name FinishExecutionRQ

Test code in simple_robot_test.robot file

*** Settings ***
Documentation    This is a very simple Robot test!

*** Test Cases ***
001 Simple Log Test Case
    Log    Hello Python!
    Log Many          Robot  Framework  Rules!!!

Test execution command

robot --listener robotframework_reportportal.listener \
--variable RP_UUID:"XXXXXX-XXXX-XXXX-XXXX-XXXXXXXX" \
--variable RP_ENDPOINT:"http://0.0.0.0:8080" \
--variable RP_LAUNCH:"Robot Launch" \
--variable RP_PROJECT:"ROBOT_INTEGRATION" \
-d Results simple_robot_test.robot

Complete output

(ROBOT_2.7) wlad@wlad-VirtualBox:~/_GITHUB/reportportal/robotframework_integration$ robot --listener robotframework_reportportal.listener \
> --variable RP_UUID:"61bbbb1d-cad0-47e3-a783-31dfe0ba70b9" \
> --variable RP_ENDPOINT:"http://0.0.0.0:8080" \
> --variable RP_LAUNCH:"Robot Launch" \
> --variable RP_PROJECT:"ROBOT_INTEGRATION" \
> -d Results simple_robot_test.robot
[ ERROR ] Taking listener 'robotframework_reportportal.listener' into use failed: Importing listener 'robotframework_reportportal.listener' failed: ImportError: cannot import name FinishExecutionRQ
Traceback (most recent call last):
  File "/home/wlad/.virtualenvs/ROBOT_2.7/local/lib/python2.7/site-packages/robotframework_reportportal/listener.py", line 5, in <module>
    from .service import RobotService
  File "/home/wlad/.virtualenvs/ROBOT_2.7/local/lib/python2.7/site-packages/robotframework_reportportal/service.py", line 3, in <module>
    from reportportal_client import (ReportPortalService, FinishExecutionRQ,
PYTHONPATH:
  /home/wlad/.virtualenvs/ROBOT_2.7/bin
  /home/wlad/.virtualenvs/ROBOT_2.7/lib/python2.7
  /home/wlad/.virtualenvs/ROBOT_2.7/lib/python2.7/plat-x86_64-linux-gnu
  /home/wlad/.virtualenvs/ROBOT_2.7/lib/python2.7/lib-tk
  /home/wlad/.virtualenvs/ROBOT_2.7/lib/python2.7/lib-old
  /home/wlad/.virtualenvs/ROBOT_2.7/lib/python2.7/lib-dynload
  /usr/lib/python2.7
  /usr/lib/python2.7/plat-x86_64-linux-gnu
  /usr/lib/python2.7/lib-tk
  /home/wlad/.virtualenvs/ROBOT_2.7/local/lib/python2.7/site-packages
  /home/wlad/_GITHUB/catinabox
  /home/wlad/.virtualenvs/ROBOT_2.7/lib/python2.7/site-packages
==============================================================================
Simple Robot Test :: This is a very simple Robot test!                        
==============================================================================
001 Simple Log Test Case                                              | PASS |
------------------------------------------------------------------------------
Simple Robot Test :: This is a very simple Robot test!                | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /home/wlad/_GITHUB/reportportal/robotframework_integration/Results/output.xml
Log:     /home/wlad/_GITHUB/reportportal/robotframework_integration/Results/log.html
Report:  /home/wlad/_GITHUB/reportportal/robotframework_integration/Results/report.html
frizzby commented 7 years ago

Hi, It seems you installed agent-Python-RobotFramework from pypi. Latest version in pypi is 2.5.4 which has invalid dependency spec. For workaround pls install directly from github for now: pip install git+https://github.com/reportportal/agent-Python-RobotFramework.git

You also see that six package is missing. So install it: pip install six. This is fixed in 7ae7c4a.

We will publish new 3.0 version to pypi when PR #11 and #12 are merged.

Tset-Noitamotua commented 7 years ago

Indeed, installing from repo with pip install git+https://github.com/reportportal/agent-Python-RobotFramework.git did the trick.

Thank you @frizzby !