Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Yusei Tahara
slapos
Commits
545ae882
Commit
545ae882
authored
Oct 20, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checkpoint/WIP: runTestSuite is available again.
parent
f8bdd3bd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
121 additions
and
86 deletions
+121
-86
slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/__init__.py
+4
-81
slapos/recipe/erp5_test/__init__.py
slapos/recipe/erp5_test/__init__.py
+74
-1
software/erp5/instance-erp5-development.cfg
software/erp5/instance-erp5-development.cfg
+41
-0
software/erp5/instance.cfg
software/erp5/instance.cfg
+0
-2
software/erp5/software.cfg
software/erp5/software.cfg
+2
-2
No files found.
slapos/recipe/erp5/__init__.py
View file @
545ae882
...
...
@@ -90,10 +90,10 @@ class Recipe(BaseSlapRecipe):
certificate
=
frontend_certificate
)
self
.
installTestRunner
(
ca_conf
,
mysql_conf
,
conversion_server_conf
,
memcached_conf
,
kumo_conf
)
self
.
installTestSuiteRunner
(
ca_conf
,
mysql_conf
,
conversion_server_conf
,
memcached_conf
,
kumo_conf
)
#
self.installTestRunner(ca_conf, mysql_conf, conversion_server_conf,
#
memcached_conf, kumo_conf)
#
self.installTestSuiteRunner(ca_conf, mysql_conf, conversion_server_conf,
#
memcached_conf, kumo_conf)
self
.
linkBinary
()
connection_dict
.
update
(
**
dict
(
site_user
=
user
,
...
...
@@ -130,83 +130,6 @@ class Recipe(BaseSlapRecipe):
sphinx_searchd_port
=
port
,
sphinx_searchd_sql_port
=
sql_port
)
def
installTestRunner
(
self
,
ca_conf
,
mysql_conf
,
conversion_server_conf
,
memcached_conf
,
kumo_conf
):
"""Installs bin/runUnitTest executable to run all tests using
bin/runUnitTest"""
testinstance
=
self
.
createDataDirectory
(
'testinstance'
)
# workaround wrong assumptions of ERP5Type.tests.runUnitTest about
# directory existence
unit_test
=
os
.
path
.
join
(
testinstance
,
'unit_test'
)
connection_string_list
=
[]
for
test_database
,
test_user
,
test_password
in
\
mysql_conf
[
'mysql_parallel_test_dict'
][
-
4
:]:
connection_string_list
.
append
(
'%s@%s:%s %s %s'
%
(
test_database
,
mysql_conf
[
'ip'
],
mysql_conf
[
'tcp_port'
],
test_user
,
test_password
))
if
not
os
.
path
.
isdir
(
unit_test
):
os
.
mkdir
(
unit_test
)
runUnitTest
=
zc
.
buildout
.
easy_install
.
scripts
([
(
'runUnitTest'
,
__name__
+
'.testrunner'
,
'runUnitTest'
)],
self
.
ws
,
sys
.
executable
,
self
.
bin_directory
,
arguments
=
[
dict
(
instance_home
=
testinstance
,
prepend_path
=
self
.
bin_directory
,
openssl_binary
=
self
.
options
[
'openssl_binary'
],
test_ca_path
=
ca_conf
[
'certificate_authority_path'
],
call_list
=
[
self
.
options
[
'runUnitTest_binary'
],
'--erp5_sql_connection_string'
,
'%(mysql_test_database)s@%'
'(ip)s:%(tcp_port)s %(mysql_test_user)s '
'%(mysql_test_password)s'
%
mysql_conf
,
'--extra_sql_connection_string_list'
,
','
.
join
(
connection_string_list
),
'--conversion_server_hostname=%(conversion_server_ip)s'
%
\
conversion_server_conf
,
'--conversion_server_port=%(conversion_server_port)s'
%
\
conversion_server_conf
,
'--volatile_memcached_server_hostname=%(memcached_ip)s'
%
memcached_conf
,
'--volatile_memcached_server_port=%(memcached_port)s'
%
memcached_conf
,
'--persistent_memcached_server_hostname=%(kumo_gateway_ip)s'
%
kumo_conf
,
'--persistent_memcached_server_port=%(kumo_gateway_port)s'
%
kumo_conf
,
]
)])[
0
]
self
.
path_list
.
append
(
runUnitTest
)
def
installTestSuiteRunner
(
self
,
ca_conf
,
mysql_conf
,
conversion_server_conf
,
memcached_conf
,
kumo_conf
):
"""Installs bin/runTestSuite executable to run all tests using
bin/runUnitTest"""
testinstance
=
self
.
createDataDirectory
(
'test_suite_instance'
)
# workaround wrong assumptions of ERP5Type.tests.runUnitTest about
# directory existence
unit_test
=
os
.
path
.
join
(
testinstance
,
'unit_test'
)
if
not
os
.
path
.
isdir
(
unit_test
):
os
.
mkdir
(
unit_test
)
connection_string_list
=
[]
for
test_database
,
test_user
,
test_password
in
\
mysql_conf
[
'mysql_parallel_test_dict'
]:
connection_string_list
.
append
(
'%s@%s:%s %s %s'
%
(
test_database
,
mysql_conf
[
'ip'
],
mysql_conf
[
'tcp_port'
],
test_user
,
test_password
))
command
=
zc
.
buildout
.
easy_install
.
scripts
([
(
'runTestSuite'
,
__name__
+
'.test_suite_runner'
,
'runTestSuite'
)],
self
.
ws
,
sys
.
executable
,
self
.
bin_directory
,
arguments
=
[
dict
(
instance_home
=
testinstance
,
prepend_path
=
self
.
bin_directory
,
openssl_binary
=
self
.
options
[
'openssl_binary'
],
test_ca_path
=
ca_conf
[
'certificate_authority_path'
],
call_list
=
[
self
.
options
[
'runTestSuite_binary'
],
'--db_list'
,
','
.
join
(
connection_string_list
),
'--conversion_server_hostname=%(conversion_server_ip)s'
%
\
conversion_server_conf
,
'--conversion_server_port=%(conversion_server_port)s'
%
\
conversion_server_conf
,
'--volatile_memcached_server_hostname=%(memcached_ip)s'
%
memcached_conf
,
'--volatile_memcached_server_port=%(memcached_port)s'
%
memcached_conf
,
'--persistent_memcached_server_hostname=%(kumo_gateway_ip)s'
%
kumo_conf
,
'--persistent_memcached_server_port=%(kumo_gateway_port)s'
%
kumo_conf
,
]
)])[
0
]
self
.
path_list
.
append
(
command
)
def
installFrontendZopeApache
(
self
,
ip
,
port
,
name
,
frontend_path
,
backend_url
,
backend_path
,
key
,
certificate
,
access_control_string
=
None
):
ident
=
'frontend_'
+
name
...
...
slapos/recipe/erp5_test/__init__.py
View file @
545ae882
...
...
@@ -25,7 +25,80 @@
#
##############################################################################
from
slapos.recipe.librecipe
import
GenericBaseRecipe
import
urlparse
class
Recipe
(
GenericBaseRecipe
):
def
install
(
self
):
pass
testinstance
=
self
.
options
[
'test-instance-path'
]
mysql_connection_string_list
=
[]
path_list
=
[]
# XXX: assume existence of 100 test databases, because slaves are not
# functional yet in slapos: test_0...test_100, with same user name
mysql_template
=
"%s@%s:%s %s %s"
mysql_parsed
=
urlparse
.
urlparse
(
self
.
options
[
'mysql-url'
])
for
i
in
range
(
0
,
100
):
mysql_connection_string_list
.
append
(
mysql_template
%
(
'test_%s'
%
i
,
mysql_parsed
.
hostname
,
mysql_parsed
.
port
,
'test_%s'
%
i
,
mysql_parsed
.
password
))
mysql_connection_string
=
mysql_template
%
(
'erp5_test'
,
mysql_parsed
.
hostname
,
mysql_parsed
.
port
,
'erp5_test'
,
mysql_parsed
.
password
)
cloudooo_parsed
=
urlparse
.
urlparse
(
self
.
options
[
'cloudooo-url'
])
memcached_parsed
=
urlparse
.
urlparse
(
self
.
options
[
'memcached-url'
])
kumofs_parsed
=
urlparse
.
urlparse
(
self
.
options
[
'kumofs-url'
])
path_list
.
append
(
self
.
createPythonScript
(
self
.
options
[
'run-unit-test'
],
__name__
+
'.test.runUnitTest'
,
[
dict
(
instance_home
=
testinstance
,
prepend_path
=
self
.
options
[
'prepend-path'
],
openssl_binary
=
self
.
options
[
'openssl-binary'
],
test_ca_path
=
self
.
options
[
'certificate-authority-path'
],
call_list
=
[
self
.
options
[
'run-unit-test-binary'
],
'--erp5_sql_connection_string'
,
mysql_connection_string
,
'--extra_sql_connection_string_list'
,
','
.
join
(
mysql_connection_string_list
),
'--conversion_server_hostname=%s'
%
cloudooo_parsed
.
hostname
,
'--conversion_server_port=%s'
%
cloudooo_parsed
.
port
,
'--volatile_memcached_server_hostname=%s'
%
memcached_parsed
.
hostname
,
'--volatile_memcached_server_port=%s'
%
memcached_parsed
.
port
,
'--persistent_memcached_server_hostname=%s'
%
kumofs_parsed
.
hostname
,
'--persistent_memcached_server_port=%s'
%
kumofs_parsed
.
port
,
])]))
return
path_list
# def installTestSuiteRunner(self, ca_conf, mysql_conf, conversion_server_conf,
# memcached_conf, kumo_conf):
# """Installs bin/runTestSuite executable to run all tests using
# bin/runUnitTest"""
# testinstance = self.createDataDirectory('test_suite_instance')
# # workaround wrong assumptions of ERP5Type.tests.runUnitTest about
# # directory existence
# unit_test = os.path.join(testinstance, 'unit_test')
# if not os.path.isdir(unit_test):
# os.mkdir(unit_test)
# mysql_connection_string_list = []
# for test_database, test_user, test_password in \
# mysql_conf['mysql_parallel_test_dict']:
# mysql_connection_string_list.append(
# '%s@%s:%s %s %s' % (test_database, mysql_conf['ip'],
# mysql_conf['tcp_port'], test_user, test_password))
# command = zc.buildout.easy_install.scripts([
# ('runTestSuite', __name__ + '.test_suite_runner', 'runTestSuite')],
# self.ws, sys.executable, self.bin_directory, arguments=[dict(
# instance_home=testinstance,
# prepend_path=self.bin_directory,
# openssl_binary=self.options['openssl_binary'],
# test_ca_path=ca_conf['certificate_authority_path'],
# call_list=[self.options['runTestSuite_binary'],
# '--db_list', ','.join(mysql_connection_string_list),
# '--conversion_server_hostname=%(conversion_server_ip)s' % \
# conversion_server_conf,
# '--conversion_server_port=%(conversion_server_port)s' % \
# conversion_server_conf,
# '--volatile_memcached_server_hostname=%(memcached_ip)s' % memcached_conf,
# '--volatile_memcached_server_port=%(memcached_port)s' % memcached_conf,
# '--persistent_memcached_server_hostname=%(kumo_gateway_ip)s' % kumo_conf,
# '--persistent_memcached_server_port=%(kumo_gateway_port)s' % kumo_conf,
# ]
# )])[0]
# self.path_list.append(command)
software/erp5/instance-erp5-development.cfg
View file @
545ae882
...
...
@@ -13,6 +13,7 @@ parts +=
request-kumofs
basedirectory
erp5-update
test-runner
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
...
...
@@ -22,6 +23,42 @@ offline = true
# default site id
site-id = erp5
[test-runner]
recipe = slapos.cookbook:erp5.test
certificate-authority-path = $${test-certificate-authority:ca-dir}
mysql-url = $${request-mariadb:connection-url}
kumofs-url = $${request-kumofs:connection-url}
memcached-url = $${request-memcached:connection-url}
cloudooo-url = $${request-cloudooo:connection-url}
test-instance-path = $${directory:unit-test-path}
prepend-path = $${buildout:bin-directory}
run-unit-test = $${buildout:bin-directory}/runUnitTest
run-test-suite = $${buildout:bin-directory}/runTestSuite
openssl-binary = $${test-certificate-authority:openssl-binary}
run-unit-test-binary = ${buildout:bin-directory}/runUnitTest
run-test-suite-binary = ${buildout:bin-directory}/runTestSuite
[test-certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:test-ca-dir}
requests-directory = $${test-cadirectory:requests}
wrapper = $${basedirectory:services}/test-ca
ca-private = $${test-cadirectory:private}
ca-certs = $${test-cadirectory:certs}
ca-newcerts = $${test-cadirectory:newcerts}
ca-crl = $${test-cadirectory:crl}
[test-cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:test-ca-dir}/requests/
private = $${directory:test-ca-dir}/private/
certs = $${directory:test-ca-dir}/certs/
newcerts = $${directory:test-ca-dir}/newcerts/
crl = $${directory:test-ca-dir}/crl/
[erp5-update]
recipe = slapos.cookbook:erp5.update
...
...
@@ -83,3 +120,7 @@ services = $${rootdirectory:etc}/run/
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
[directory]
test-ca-dir = $${rootdirectory:srv}/test-ca/
test-instance-path = $${rootdirectory:srv}/test-instance/
unit-test-path = $${:test-instance-path}/unit_test/
software/erp5/instance.cfg
View file @
545ae882
[instance]
rdiff_backup_binary = ${buildout:bin-directory}/rdiff-backup
runTestSuite_binary = ${buildout:bin-directory}/runTestSuite
runUnitTest_binary = ${buildout:bin-directory}/runUnitTest
sphinx_searchd_binary = ${sphinx:location}/bin/searchd
[buildout]
...
...
software/erp5/software.cfg
View file @
545ae882
...
...
@@ -46,7 +46,7 @@ mode = 0644
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum =
5a8d8751d715eee6f98102328948f44b
md5sum =
23f40eb3a9a51c4fcd2acd4270cfe626
output = ${buildout:directory}/template.cfg
mode = 0644
...
...
@@ -60,7 +60,7 @@ mode = 0644
[template-erp5-development]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-erp5-development.cfg
md5sum =
97670f46ef45f1314ed03a71df56de4d
md5sum =
79216b0c413b373b0dbe00220a0fbaf9
output = ${buildout:directory}/template-erp5-development.cfg
mode = 0644
...
...
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