Robot-server with plone 6.0.0a4 minimal setup not working

Prerequisite:

  • Python 3.9 venv
  • setuptools==62.1.0 and zc.buildout==3.0.0rc3 installed

This is my minimal buildout to get a robot-server script:

[buildout]
extends =
    http://dist.plone.org/release/6-latest/versions.cfg


parts += testserver


[testserver]
recipe = zc.recipe.egg
eggs =
    plone.app.robotframework [test]
scripts =
    robot-server

[versions]
plone.app.robotframework = 2.0.0a6

However if i start the server via:

$ ./bin/robot-server plone.app.testing.layers.PLONE_WSGISERVER -vvvv --debug

...
16:18:31 [ wait ] Set up plone.testing.zope.WSGIServer
INFO:Zope:Ready to handle requests
16:18:31 [ wait ] Set up plone.app.testing.layers.Plone:WSGIServer
16:18:31 [ ready ] Started Zope robot server
XMLRPC: http://127.0.0.1:49999

I'm not able to get anything from that instance. respectively I get a 501:

Error response
Error code: 501

Message: Unsupported method ('GET').

Error code explanation: HTTPStatus.NOT_IMPLEMENTED - Server does not support this operation.

I tried several other options, like creating my own mixin or use the volto testing layers (./bin/robot-server plone.app.robotframework.testing.VOLTO_ROBOT_TESTING -vvvv --debug). Same result.

It starts up, testing layer seems to get applied as well. But still 501.
Any help is really appreciated :blush:

I know I'm using the latest versions of everything and you guys are working hard on plone 6. Maybe somebody hat the same issues or I'm missing something obvious?

See if your problem is not this one: How to use robot-server and pybot with not fiddling with env variables? · Issue #60 · plone/plone.testing · GitHub

Thanks, but I know on which port the service is running. The service itself replies with 501 in the browser and in the logs. I can change the port, but I do get the same result.

the only way for me to run robot tests:

start Server:

ZSERVER_HOST=127.0.0.1 ZSERVER_PORT=50003 bin/robot-server --reload-path src dev.robotcheck.testing.DEV_ROBOTCHECK_ACCEPTANCE_TESTING

start the Test:

ZSERVER_HOST=127.0.0.1 ZSERVER_PORT=50003 TMPDIR=./tmp bin/robot src/dev/robotcheck/tests/robot/test_example.robot

site note: the TMPDIR is necessary to run the test in Browsers, which are installed via snap in ubuntu. i'am on ubunut 22.04

all other fails, e.g.:

./bin/test --all -m  dev.robotcheck -t test_example.robot
or 
TMPDIR=/tmp ./bin/test --all -m  dev.robotcheck -t test_example.robot
1 Like

on MacOS I'm not able to start robot-server ... I get

08:26:28 [ wait ] Starting Zope robot server
08:26:28 [ wait ] Set up plone.testing.zca.LayerCleanup
08:26:28 [ wait ] Set up plone.testing.zope.Startup
08:26:28 [ wait ] Set up plone.app.testing.layers.PloneFixture
08:26:30 [ wait ] Watchdog is watching for changes in src
08:26:30 [ wait ] Fork loop now starting on parent process 91846
08:26:30 [ wait ] Fork loop forked a new child process 91847
08:26:30 [ wait ] Set up plone.app.event.testing.PAEventLayer
08:26:30 [ wait ] Set up plone.app.contenttypes.testing.PloneAppContenttypes
08:26:30 [ wait ] Set up Products.CMFPlone.testing.ProductsCMFPloneLayer
08:26:30 [ wait ] Set up plone.app.robotframework.remote.CMFPloneRobotRemoteLibrary:RobotRemote
08:26:30 [ wait ] Set up plone.testing.zope.WSGIServer
objc[91847]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[91847]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
08:26:30 [ ERROR ] Forked child process 91847 terminated by signal 6
08:26:31 [ ERROR ] Forked child process died on bootup. Fix possible errors and save edits. We are now paused until we detect the next file change...

when I do bin/robot-server -v Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING

Does anyone have an idea?

Turns out it was a multiprocessing problem.

Setting ENV var disable_proxy=1 solved my problem (see Multiprocessing causes Python to crash and gives an error may have been in progress in another thread when fork() was called - Stack Overflow) :

disable_proxy=1 bin/robot-server Products.CMFPlone.testing.PRODUCTS_CMFPLONE_ROBOT_TESTING

My environment: Mac Studio M1 Max with OS 12.4

Sorry for bringing up the old thread, it's only sake of completeness:

Robottests in your Package my.addon

Side Note:
Linux Ubuntu 22.04
If you had installed chromium via snap, please install also sudo apt install chromium-chromedriver . Don't use the manually downloaded chromedriver.

Test with chrome

ROBOT_BROWSER=chrome zope-testrunner --auto-color --auto-progress --test-path=./src --all

Test with chrome and a specific layer

ROBOT_BROWSER=chrome zope-testrunner --auto-color --auto-progress --test-path=./src --all --layer=AcceptanceTestingMyLayer

Test with chrome and a specific layer and a specific test

ROBOT_BROWSER=chrome zope-testrunner --auto-color --auto-progress --test-path=./src --all --layer=AcceptanceTestingMyLayer -t "test_my_first_test.robot"

Test with chrome headless

ROBOT_BROWSER=headlesschrome zope-testrunner --auto-color --auto-progress --test-path=./src --all

Test with chrome headless and a specific layer

ROBOT_BROWSER=headlesschrome zope-testrunner --auto-color --auto-progress --test-path=./src --all --layer=AcceptanceTestingMyLayer

Test with chrome headless a specific layer and a specific test

ROBOT_BROWSER=headlesschrome zope-testrunner --auto-color --auto-progress --test-path=./src --all --layer=AcceptanceTestingMyLayer -t "test_my_first_test.robot"

Test with firefox

ROBOT_BROWSER=firefox zope-testrunner --auto-color --auto-progress --test-path=./src --all

Test with firefox and a specific layer

ROBOT_BROWSER=firefox zope-testrunner --auto-color --auto-progress --test-path=./src --all --layer=AcceptanceTestingMyLayer

Test with firefox a specific layer and a specific test

ROBOT_BROWSER=firefox zope-testrunner --auto-color --auto-progress --test-path=./src --all --layer=AcceptanceTestingMyLayer -t "test_my_first_test.robot"