chrisBrookes93 / robotframework-remoterunner

This library provides a robotframework agent, and accompanying robot executor script that allows you to run Robot Framework Test Suites remotely. It's designed to be a lightweight agent and can be used as an alternative, or with a CI Agent (e.g. Jenkins Agent).
MIT License
8 stars 8 forks source link

robotframework-remoterunner not working ! #16

Open embetrix opened 2 years ago

embetrix commented 2 years ago

running a simple test remotely on an agent seems to be working

rfremoterun 192.168.178.100 simple_suite.robot 
Connecting to: http://192.168.178.100:1471

Robot execution response:
==============================================================================
Root                                                                          
==============================================================================
Root.Simple Suite                                                             
==============================================================================
Simple Test Case 1                                                    | PASS |
------------------------------------------------------------------------------
Simple Test Case 2                                                    | PASS |
------------------------------------------------------------------------------
Simple Test Case 3                                                    | PASS |
------------------------------------------------------------------------------
Root.Simple Suite                                                     | PASS |
3 tests, 3 passed, 0 failed
==============================================================================
Root                                                                  | PASS |
3 tests, 3 passed, 0 failed
==============================================================================
Output:  /tmp/tmpxvhwx81v/output.xml
Log:     /tmp/tmpxvhwx81v/log.html
Report:  /tmp/tmpxvhwx81v/report.html

Local Output:  /home/zaki/Projects/Playground/robot/remote_output.xml
Local Log:     /home/zaki/Projects/Playground/robot/remote_log.html
Local Report:  /home/zaki/Projects/Playground/robot/remote_report.html

But a son as any Library is involved this does absolutely not work!!!

rfremoterun 192.168.178.100 scp.robot 
Traceback (most recent call last):
  File "/usr/local/bin/rfremoterun", line 8, in <module>
    sys.exit(run_executor())
  File "/usr/local/lib/python3.8/dist-packages/rfremoterunner/executor.py", line 25, in run_executor
    result = rfs.execute_run(arg_parser.suites, arg_parser.extension, arg_parser.suite, arg_parser.robot_run_args)
  File "/usr/local/lib/python3.8/dist-packages/rfremoterunner/rf_client.py", line 63, in execute_run
    self._package_suite_hierarchy(suite)
  File "/usr/local/lib/python3.8/dist-packages/rfremoterunner/rf_client.py", line 109, in _package_suite_hierarchy
    self._suites[suite_filename] = self._process_test_suite(suite)
  File "/usr/local/lib/python3.8/dist-packages/rfremoterunner/rf_client.py", line 134, in _process_test_suite
    updated_file = self._process_robot_file(suite)
  File "/usr/local/lib/python3.8/dist-packages/rfremoterunner/rf_client.py", line 191, in _process_robot_file
    self._dependencies[filename] = read_file_from_disk(full_path)
  File "/usr/local/lib/python3.8/dist-packages/rfremoterunner/utils.py", line 30, in read_file_from_disk
    with open(path, 'r', encoding=encoding) as file_handle:
IsADirectoryError: [Errno 21] Is a directory: '/usr/local/lib/python3.8/dist-packages/SCPLibrary
embetrix commented 2 years ago

I did install all the robot framework libraries used on the host on the agent

On host:

pip3 list | grep robot
robotframework                  5.0.1    
robotframework-fritzhomelibrary 1.3.0    
robotframework-remoterunner     2.0.0    
robotframework-scplibrary       1.2.0    
robotframework-seriallibrary    0.4.3    
robotframework-sshlibrary       3.8.0 

On Agent:

root@raspberrypi:~# pip3 list | grep robot
robotframework                  5.0.1    
robotframework-fritzhomelibrary 1.3.0    
robotframework-remoterunner     2.0.0    
robotframework-scplibrary       1.2.0    
robotframework-seriallibrary    0.4.3    
robotframework-sshlibrary       3.8.0   
embetrix commented 2 years ago

it looks like the problem is located at

https://github.com/chrisBrookes93/robotframework-remoterunner/blob/main/src/rfremoterunner/rf_client.py#L191

it expect that the Library is a file which is NOT in case of using a robotframework library it's a folder.

would be possible to add libraries from robotframwork ? without that I think this extension is seriously limited !

embetrix commented 2 years ago

I commented that line and it worked since the libraries are installed on both agent and host.

This is definitely a Bug that should be fixed