Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
f4652d73
Commit
f4652d73
authored
Aug 27, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: update --neo_storage runUnit option for NEO 1.0
parent
f231ac72
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
20 deletions
+38
-20
bt5/test_conflict_resolution/TestTemplateItem/testConflictResolution.py
...ict_resolution/TestTemplateItem/testConflictResolution.py
+5
-8
bt5/test_conflict_resolution/bt/revision
bt5/test_conflict_resolution/bt/revision
+1
-1
product/ERP5Type/tests/custom_zodb.py
product/ERP5Type/tests/custom_zodb.py
+31
-9
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+1
-2
No files found.
bt5/test_conflict_resolution/TestTemplateItem/testConflictResolution.py
View file @
f4652d73
...
@@ -91,32 +91,29 @@ class TestERP5(ERP5TypeTestCase):
...
@@ -91,32 +91,29 @@ class TestERP5(ERP5TypeTestCase):
return
'erp5_base'
,
'test_conflict_resolution'
return
'erp5_base'
,
'test_conflict_resolution'
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
other_node
=
self
.
getOtherZ
EOClient
Node
()
other_node
=
self
.
getOtherZ
ope
Node
()
self
.
other_node
=
self
.
portal
.
portal_web_services
.
connect
(
self
.
other_node
=
self
.
portal
.
portal_web_services
.
connect
(
"http://%s%s"
%
(
other_node
,
self
.
portal
.
getPath
()),
"http://%s%s"
%
(
other_node
,
self
.
portal
.
getPath
()),
'ERP5TypeTestCase'
,
''
,
'xml-rpc'
)
'ERP5TypeTestCase'
,
''
,
'xml-rpc'
)
self
.
login
()
self
.
login
()
def
getOtherZEOClientNode
(
self
):
def
getOtherZopeNode
(
self
):
from
ZEO.ClientStorage
import
ClientStorage
storage
=
self
.
portal
.
_p_jar
.
_storage
activity_tool
=
self
.
portal
.
portal_activities
activity_tool
=
self
.
portal
.
portal_activities
node_list
=
list
(
activity_tool
.
getProcessingNodeList
())
node_list
=
list
(
activity_tool
.
getProcessingNodeList
())
node_list
.
remove
(
activity_tool
.
getCurrentNode
())
node_list
.
remove
(
activity_tool
.
getCurrentNode
())
assert
node_list
and
isinstance
(
storage
,
ClientStorage
),
\
assert
node_list
,
"this unit test must be run with at least 2 Zope nodes"
"this unit test must be run with at least 2 ZEO clients"
return
node_list
[
0
]
return
node_list
[
0
]
def
testZODBCookie
(
self
):
def
testZODBCookie
(
self
):
cookie_name
=
self
.
_testMethodName
cookie_name
=
self
.
_testMethodName
portal
=
self
.
portal
portal
=
self
.
portal
self
.
assertEqual
(
0
,
portal
.
getCacheCookie
(
cookie_name
))
cookie
=
portal
.
getCacheCookie
(
cookie_name
)
# 0
self
.
commit
()
self
.
commit
()
portal
.
newCacheCookie
(
cookie_name
)
# 1
portal
.
newCacheCookie
(
cookie_name
)
# 1
self
.
other_node
.
newCacheCookie
(
cookie_name
)
# 1
self
.
other_node
.
newCacheCookie
(
cookie_name
)
# 1
self
.
other_node
.
newCacheCookie
(
cookie_name
)
# 2
self
.
other_node
.
newCacheCookie
(
cookie_name
)
# 2
self
.
commit
()
# max(1, 2) + 1
self
.
commit
()
# max(1, 2) + 1
self
.
assertEqual
(
3
,
portal
.
getCacheCookie
(
cookie_name
))
self
.
assertEqual
(
cookie
+
3
,
portal
.
getCacheCookie
(
cookie_name
))
def
testActiveProcess
(
self
):
def
testActiveProcess
(
self
):
active_process
=
self
.
portal
.
portal_activities
.
newActiveProcess
()
active_process
=
self
.
portal
.
portal_activities
.
newActiveProcess
()
...
...
bt5/test_conflict_resolution/bt/revision
View file @
f4652d73
3
4
\ No newline at end of file
\ No newline at end of file
product/ERP5Type/tests/custom_zodb.py
View file @
f4652d73
...
@@ -82,7 +82,7 @@ if load:
...
@@ -82,7 +82,7 @@ if load:
if
not
live_instance_path
:
if
not
live_instance_path
:
backup_path
=
os
.
path
.
basename
(
backup_path
)
backup_path
=
os
.
path
.
basename
(
backup_path
)
os
.
symlink
(
backup_path
,
full_path
)
os
.
symlink
(
backup_path
,
full_path
)
elif
save
and
not
zeo_client
and
os
.
path
.
exists
(
data_fs_path
):
elif
save
and
not
(
neo_storage
or
zeo_client
)
and
os
.
path
.
exists
(
data_fs_path
):
os
.
remove
(
data_fs_path
)
os
.
remove
(
data_fs_path
)
for
static_dir
in
static_dir_list
:
for
static_dir
in
static_dir_list
:
...
@@ -126,16 +126,38 @@ def forkNodes():
...
@@ -126,16 +126,38 @@ def forkNodes():
cluster
=
True
cluster
=
True
if
neo_storage
:
if
neo_storage
:
if
load
or
save
or
zeo_client
:
if
zeo_client
:
raise
Exception
(
"--neo_storage conflicts with --load/save/zeo_client"
)
sys
.
exit
(
"--neo_storage conflicts with --zeo_client"
)
demo_storage
=
load
and
not
save
if
activity_node
>
1
and
demo_storage
:
sys
.
exit
(
"--save is required when running several"
" zope nodes on an existing NEO database"
)
from
neo.lib
import
logging
from
neo.tests.functional
import
NEOCluster
from
neo.tests.functional
import
NEOCluster
neo_cluster
=
NEOCluster
(
range
(
2
),
partitions
=
4
,
adapter
=
'BTree'
,
logging
.
backlog
()
temp_dir
=
os
.
getcwd
(),
verbose
=
False
)
storage_count
=
2
sigint
=
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_IGN
)
if
load
or
save
:
neo_cluster
.
start
()
db_list
=
[
os
.
path
.
join
(
instance_home
,
'var'
,
'neo%u.sqlite'
%
i
)
signal
.
signal
(
signal
.
SIGINT
,
sigint
)
for
i
in
xrange
(
1
,
storage_count
+
1
)]
else
:
db_list
=
[
None
]
*
storage_count
cwd
=
os
.
getcwd
()
neo_cluster
=
NEOCluster
(
db_list
,
partitions
=
4
,
name
=
'erp5/unit_test'
,
temp_dir
=
cwd
,
logger
=
save
,
adapter
=
'SQLite'
,
clear_databases
=
not
load
)
forkNodes
()
forkNodes
()
Storage
=
neo_cluster
.
getZODBStorage
()
if
node_pid_list
is
None
:
save_mysql
=
None
else
:
cluster
=
bool
(
node_pid_list
)
sigint
=
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_IGN
)
try
:
neo_cluster
.
start
()
finally
:
signal
.
signal
(
signal
.
SIGINT
,
sigint
)
Storage
=
neo_cluster
.
getZODBStorage
(
read_only
=
demo_storage
)
if
demo_storage
:
Storage
=
DemoStorage
(
base
=
Storage
)
else
:
else
:
neo_cluster
=
None
neo_cluster
=
None
while
not
zeo_client
:
while
not
zeo_client
:
...
...
product/ERP5Type/tests/runUnitTest.py
View file @
f4652d73
...
@@ -138,8 +138,7 @@ Options:
...
@@ -138,8 +138,7 @@ Options:
Make ZServer listen on given host:port
Make ZServer listen on given host:port
If used with --activity_node=, this can be a
If used with --activity_node=, this can be a
comma-separated list of addresses.
comma-separated list of addresses.
--neo_storage Use a volatile NEO storage instead of a DemoStorage
--neo_storage Use a NEO storage (SQLite) instead of FileStorage.
(not compatible with --save or --load).
--products_path=path,path Comma-separated list of products paths locations
--products_path=path,path Comma-separated list of products paths locations
which shall be used in test environment.
which shall be used in test environment.
--sys_path=path,path Comma-separated list of paths which will be used to
--sys_path=path,path Comma-separated list of paths which will be used to
...
...
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