Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
f3da4b0e
Commit
f3da4b0e
authored
Jun 05, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/erp5: integrate selenium server in tests
parent
33f6e5cd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
146 additions
and
3 deletions
+146
-3
software/erp5/instance-erp5-input-schema.json
software/erp5/instance-erp5-input-schema.json
+95
-0
software/erp5/test/test/test_erp5.py
software/erp5/test/test/test_erp5.py
+39
-0
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+3
-3
stack/erp5/instance-erp5.cfg.in
stack/erp5/instance-erp5.cfg.in
+1
-0
stack/erp5/instance-zope.cfg.in
stack/erp5/instance-zope.cfg.in
+7
-0
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+1
-0
No files found.
software/erp5/instance-erp5-input-schema.json
View file @
f3da4b0e
...
...
@@ -525,6 +525,101 @@
"description"
:
"Number of extra databases this instance tests will need."
,
"default"
:
3
,
"type"
:
"integer"
},
"selenium"
:
{
"default"
:
{
"target"
:
"firefox"
},
"examples"
:
[
{
"target"
:
"selenium-server"
,
"server-url"
:
"https://selenium.example.com"
,
"desired-capabilities"
:
{
"browserName"
:
"firefox"
,
"version"
:
"68.0.2esr"
,
"acceptInsecureCerts"
:
true
}
},
{
"target"
:
"selenium-server"
,
"server-url"
:
"https://selenium.example.com"
,
"desired-capabilities"
:
{
"browserName"
:
"chrome"
,
"version"
:
"91.0.4472.101"
}
}
],
"oneOf"
:
[
{
"type"
:
"object"
,
"title"
:
"Selenium Server"
,
"description"
:
"Configuration for Selenium server"
,
"additionalProperties"
:
false
,
"required"
:
[
"desired-capabilities"
,
"server-url"
,
"target"
],
"properties"
:
{
"target"
:
{
"description"
:
"Target system"
,
"type"
:
"string"
,
"const"
:
"selenium-server"
},
"server-url"
:
{
"description"
:
"URL of the selenium server"
,
"type"
:
"string"
,
"format"
:
"uri"
},
"verify-server-certificate"
:
{
"description"
:
"Verify the SSL/TLS certificate of the selenium server when using HTTPS"
,
"type"
:
"boolean"
,
"default"
:
true
},
"server-ca-certificate"
:
{
"description"
:
"PEM encoded bundle of CA certificates to verify the SSL/TLS certificate of the selenium server when using HTTPS"
,
"type"
:
"string"
,
"default"
:
"Root certificates from http://certifi.io/en/latest/"
},
"desired-capabilities"
:
{
"description"
:
"Desired browser capabilities"
,
"required"
:
[
"browserName"
],
"type"
:
"object"
,
"properties"
:
{
"browserName"
:
{
"description"
:
"Name of the browser being used"
,
"type"
:
"string"
,
"examples"
:
[
"firefox"
,
"chrome"
,
"safari"
]
},
"version"
:
{
"description"
:
"The browser version"
,
"type"
:
"string"
}
}
}
}
},
{
"type"
:
"object"
,
"title"
:
"Firefox"
,
"description"
:
"Configuration for using firefox running as a sub-process"
,
"additionalProperties"
:
false
,
"properties"
:
{
"target"
:
{
"description"
:
"Target system"
,
"const"
:
"firefox"
,
"type"
:
"string"
,
"default"
:
"firefox"
}
}
}
]
}
},
"type"
:
"object"
...
...
software/erp5/test/test/test_erp5.py
View file @
f3da4b0e
...
...
@@ -218,6 +218,45 @@ class TestBalancerPorts(ERP5InstanceTestCase):
]))
class
TestSeleniumTestRunner
(
ERP5InstanceTestCase
,
TestPublishedURLIsReachableMixin
):
"""Test ERP5 can be instantiated with selenium server for test runner.
"""
__partition_reference__
=
'sel'
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'test-runner'
:
{
'selenium'
:
{
"target"
:
"selenium-server"
,
"server-url"
:
"https://example.com"
,
"verify-server-certificate"
:
False
,
"desired-capabilities"
:
{
"browserName"
:
"firefox"
,
"version"
:
"68.0.2esr"
,
}
}
}
})
}
def
test_test_runner_configuration_json_file
(
self
):
runUnitTest_script
,
=
glob
.
glob
(
self
.
computer_partition_root_path
+
"/../*/bin/runUnitTest.real"
)
config_file
=
None
with
open
(
runUnitTest_script
)
as
f
:
for
line
in
f
:
if
'ERP5_TEST_RUNNER_CONFIGURATION'
in
line
:
_
,
config_file
=
line
.
split
(
'='
)
assert
config_file
with
open
(
config_file
.
strip
())
as
f
:
self
.
assertEqual
(
f
.
read
(),
json
.
dumps
(
json
.
loads
(
self
.
getInstanceParameterDict
()[
'_'
])[
'test-runner'
]))
class
TestDisableTestRunner
(
ERP5InstanceTestCase
,
TestPublishedURLIsReachableMixin
):
"""Test ERP5 can be instantiated without test runner.
"""
...
...
stack/erp5/buildout.hash.cfg
View file @
f3da4b0e
...
...
@@ -70,11 +70,11 @@ md5sum = 7a14019abf48ca100eb94d9add20f5ae
[template]
filename = instance.cfg.in
md5sum =
8bd7f89b7c1e453ecc952659a01347e6
md5sum =
bbef65b4edeb342f08309604ca3717d5
[template-erp5]
filename = instance-erp5.cfg.in
md5sum =
f33e82cb68924decb77142b79dce4fab
md5sum =
49b7e029c7fca7c95d3bfd8876d1a632
[template-zeo]
filename = instance-zeo.cfg.in
...
...
@@ -86,7 +86,7 @@ md5sum = bc821f9f9696953b10a03ad7b59a1936
[template-zope]
filename = instance-zope.cfg.in
md5sum =
e495f7225a49f61c501ccc496a976d63
md5sum =
4f0db10bc08074178e05b32cba0cb3f2
[template-balancer]
filename = instance-balancer.cfg.in
...
...
stack/erp5/instance-erp5.cfg.in
View file @
f3da4b0e
...
...
@@ -260,6 +260,7 @@ config-wsgi = {{ dumps(slapparameter_dict.get('wsgi', True)) }}
config-test-runner-enabled = {{ dumps(test_runner_enabled) }}
config-test-runner-node-count = {{ dumps(test_runner_node_count) }}
config-wcfs_enable = {{ dumps(wcfs_enable) }}
config-test-runner-configuration = {{ dumps(slapparameter_dict.get('test-runner', {})) }}
software-type = zope
{% set global_publisher_timeout = slapparameter_dict.get('publisher-timeout') -%}
...
...
stack/erp5/instance-zope.cfg.in
View file @
f3da4b0e
...
...
@@ -470,6 +470,7 @@ environment-extra =
REAL_INSTANCE_HOME=${:instance-home}
SQLBENCH_PATH={{ parameter_dict['sqlbench_path'] }}
TEST_CA_PATH=${directory:ca-dir}
ERP5_TEST_RUNNER_CONFIGURATION=${test-runner-configuration:rendered}
{%- if wsgi %}
erp5_wsgi=1
{%- endif %}
...
...
@@ -488,6 +489,12 @@ command-line =
--persistent_memcached_server_hostname=erp5-memcached-persistent
--persistent_memcached_server_port={{ port_dict['erp5-memcached-persistent'] }}
[test-runner-configuration]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/${:_buildout_section_name_}.json
template = inline:
{{ json.dumps(slapparameter_dict['test-runner-configuration']) }}
[{{ section('runUnitTest') }}]
< = run-test-common
command-name = runUnitTest
...
...
stack/erp5/instance.cfg.in
View file @
f3da4b0e
...
...
@@ -128,6 +128,7 @@ extra-context =
import urlparse urlparse
import hashlib hashlib
import itertools itertools
import json json
import-list =
file instance_zodb_base context:template-zodb-base
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment