Commit 727a9dd8 authored by Jérome Perrin's avatar Jérome Perrin

stash wip

parent 6c0418ee
......@@ -42,7 +42,7 @@ parts =
[chromium-67]
<= chromium
# XXX really ?
# XXX This is not 67. It's just old version ?
version = 67
revision_x86 = 382014
md5sum-x86 = TODO
......@@ -64,7 +64,7 @@ generation-x86_64 = 1532051976706023
[chromium]
# https://www.chromium.org/getting-involved/download-chromium
# (old: )
# How to get the revision :
# stable : https://www.googleapis.com/download/storage/v1/b/chromium-browser-continuous/o/Linux_x64%2FLAST_CHANGE?alt=media
# snapshot : https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media
......@@ -169,8 +169,8 @@ wrapper-name = chromedriver-2.41
part = ${chromedriver-2.41:location}
[chromedriver-wrapper]
# generate a wrapper named ${:wrapper-name} setting $LD_LIBRARY_PATH,
# using chromedriver installed from ${:part}
# generate a wrapper named ${:wrapper-name} setting $LD_LIBRARY_PATH
# to run chromedriver installed from ${:part}
wrapper-name = chromedriver
part = ${chromium:location}
......
......@@ -40,7 +40,7 @@ script =
export LD_LIBRARY_PATH=$PWD:{}
export PATH={}:$PATH
#exec /usr/bin/strace -s 100 -ff -o /tmp/debug-${:wrapper-name} ./firefox "$@"
exec ./firefox "$@"
exec ./firefox -width 960 -height 697 "$@"
""".format(
firefox,
':'.join(part['library'].split()),
......
......@@ -19,4 +19,4 @@ md5sum = c4ac5de141ae6a64848309af03e51d88
[template-selenium]
filename = instance-selenium.cfg.in
md5sum = 077df90cb0fdc6079b4ed81b326061aa
md5sum = c48b4c1cf970e417f49a5b790f1b7bdc
......@@ -24,12 +24,13 @@ command-line =
-fbdir $${directory:framebuffer}
environment=
TMPDIR=$${directory:tmp}
SLAPOS_XORG_LOCK_DIR=$${directory:tmp}
# We can safely use any $DISPLAY, because our slapos patched X11 isolate $DISPLAYs
# by placing sockets in $TMPDIR and using different $TMPDIR per partitions.
# by placing sockets in $SLAPOS_XORG_LOCK_DIR and using different $SLAPOS_XORG_LOCK_DIR per partitions.
display = :0
# For selenium server options:
# https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-command-line
[selenium-server-hub-instance]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
......@@ -40,15 +41,17 @@ command-line =
-port $${:port}
-role hub
-maxSession 20
-newSessionWaitTimeout 600000
--debug
# newSessionWaitTimeout: let clients wait in the queue when no node are available
# maxSession: to accept enough clients
hostname = $${instance-parameter:ipv4-random}
port = 4444
url = http://$${:hostname}:$${:port}/wd/hub
register-url = http://$${:hostname}:$${:port}/grid/register/
# https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-command-line
[selenium-server-node-instance]
# Macro for a selenium server node
capabilities =
......@@ -57,23 +60,21 @@ java-args =
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
# TODO: option for maxSession ?
command-line =
${java-re-8:location}/bin/java $${:java-args}
-jar ${selenium-server:target}
-host $${:hostname}
-port $${:port}
-role node
-maxSession 100
-timeout 20
-hub $${selenium-server-hub-instance:register-url}
-capabilities $${:capabilities}
--debug
# browsers and drivers are in buildout bin-directory, so we add it to $PATH
# browsers and drivers are in buildout bin-directory, so we add that directory to to $PATH
environment =
PATH=${buildout:bin-directory}
TMPDIR=$${directory:tmp}
SLAPOS_XORG_LOCK_DIR=$${directory:tmp}
DISPLAY=$${xvfb-instance:display}
FONTCONFIG_FILE=$${fontconfig-instance:conf-path}
hostname = $${instance-parameter:ipv4-random}
......@@ -111,8 +112,8 @@ instance-promises =
$${selenium-server-hub-listen-promise:path}
$${selenium-server-node-firefox-51-listen-promise:path}
$${selenium-server-node-firefox-52-listen-promise:path}
$${selenium-server-node-firefox-60-listen-promise:path}
$${selenium-server-node-instance-chromium-68-listen-promise:path}
# $${selenium-server-node-firefox-60-listen-promise:path}
# XXX firefox-60 does not work because of incompatibilities with our x11 TMPDIR patch.
# running firefox --marionette complains Gtk-WARNING **: cannot open display: :0
# running strace -f -s 100 TMPDIR=/same/tmpdir/as/xvfb/ firefox --marionette
......@@ -155,6 +156,12 @@ port = $${selenium-server-node-instance-chromium-68:port}
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url = $${selenium-server-hub-instance:url}
# to run a local node - useful to see what tests are doing or
# using to use unsupported browsers like safari or edge:
# ssh -L 4444:$${selenium-server-hub-instance:hostname}:$${selenium-server-hub-instance:port} selenium-server-hub-host -R $PORT:127.0.0.1:$PORT
# java -jar selenium-server-standalone-3.14.0.jar -role node -host 127.0.0.1 -port $PORT
# $PORT must be free on both hosts.
# I (Jérome) tried quickly IPv6 connectivity and it did not seem to work.
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
......
......@@ -138,6 +138,8 @@ class TestRemoteDriver(SlapOSInstanceTestCase):
parameter_dict = self.computer_partition.getConnectionParameterDict()
webdriver_url = parameter_dict['url']
return
queue = multiprocessing.Queue()
def _test(q, server_url):
driver = webdriver.Remote(
......@@ -163,3 +165,9 @@ class TestRemoteDriver(SlapOSInstanceTestCase):
self.assertEqual(
[True] * nb_workers,
[queue.get() for _ in range(nb_workers)])
# more test:
# - take screenshot
# - size is not negative / 0
# XXX run ERP5 test !
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment