Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
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
Hardik Juneja
wendelin
Commits
f4d338f9
Commit
f4d338f9
authored
Mar 30, 2017
by
Hardik Juneja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add erp5 test suite
parent
4888f507
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
tests/__init__.py
tests/__init__.py
+66
-0
No files found.
tests/__init__.py
View file @
f4d338f9
...
...
@@ -2,6 +2,7 @@ from test_suite import ERP5TypeTestSuite
import
glob
import
os.path
import
re
import
sys
HERE
=
os
.
path
.
dirname
(
__file__
)
BT5
=
os
.
path
.
join
(
os
.
path
.
split
(
HERE
)[
0
],
'bt5'
)
...
...
@@ -16,4 +17,69 @@ class WendelinERP5(ERP5TypeTestSuite):
return
[
'%s:%s'
%
(
x
.
group
(
1
),
x
.
group
(
2
))
\
for
x
in
[
component_re
.
match
(
y
)
for
y
in
glob
.
glob
(
os
.
path
.
join
(
BT5
,
'*'
,
'*'
,
'*'
,
'test.erp5.test*.py'
))]]
class
ERP5
(
ERP5TypeTestSuite
):
mysql_db_count
=
3
def
_getAllERP5TestList
(
self
):
test_list
=
[]
#xxx: this is implemented in a hackish way
path
=
os
.
path
.
join
(
os
.
path
.
split
(
sys
.
path
[
0
])[
0
],
'erp5'
)
component_re
=
re
.
compile
(
".*/([^/]+)/TestTemplateItem/portal_components"
"/test
\
.[^.]+
\
.([^.]+).py$"
)
for
test_path
in
(
glob
.
glob
(
'%s/product/*/tests/test*.py'
%
path
)
+
glob
.
glob
(
'%s/bt5/*/TestTemplateItem/test*.py'
%
path
)
+
glob
.
glob
(
'%s/bt5/*/TestTemplateItem/portal_components/test.*.test*.py'
%
path
)):
component_re_match
=
component_re
.
match
(
test_path
)
if
component_re_match
is
not
None
:
test_case
=
"%s:%s"
%
(
component_re_match
.
group
(
1
),
component_re_match
.
group
(
2
))
else
:
test_case
=
test_path
.
split
(
os
.
sep
)[
-
1
][:
-
3
]
product
=
test_path
.
split
(
os
.
sep
)[
-
3
]
# don't test 3rd party products
if
product
in
(
'PortalTransforms'
,
'MailTemplates'
,
'Zelenium'
):
continue
# ERP5TioSafe is disabled for now because it requires external programs
# such as php and it has not been updated for Zope >= 2.12
if
product
==
'ERP5TioSafe'
:
continue
test_list
.
append
(
test_case
)
return
test_list
def
run
(
self
,
full_test
):
test
=
':'
in
full_test
and
full_test
.
split
(
':'
)[
1
]
or
full_test
if
test
in
(
'testConflictResolution'
,
'testInvalidationBug'
):
status_dict
=
self
.
runUnitTest
(
'--save'
,
full_test
)
if
not
status_dict
[
'status_code'
]:
status_dict
=
self
.
runUnitTest
(
'--load'
,
'--activity_node=2'
,
full_test
)
return
status_dict
return
super
(
ERP5
,
self
).
run
(
full_test
)
def
getTestList
(
self
):
test_list
=
[]
for
full_test_case
in
self
.
_getAllERP5TestList
():
test_case
=
(
':'
in
full_test_case
and
full_test_case
.
split
(
':'
)[
1
]
or
full_test_case
)
# skip some tests
if
test_case
.
startswith
(
'testLive'
)
or
test_case
.
startswith
(
'testVifib'
)
\
or
test_case
.
find
(
'Performance'
)
>
0
\
or
test_case
in
(
'testERP5LdapCatalog'
,
# XXX (Ivan), until LDAP server is available this test will alway fail
# tests reading selenium tables from erp5.com
# not maintained
'testFunctionalConfigurator'
,
'testFunctionalConfiguratorConsulting'
,
'testERP5eGov'
,
'testAccounting_l10n_fr_m9'
,
# Not a test
'testERP5SyncMLMixin'
):
continue
test_list
.
append
(
full_test_case
)
return
test_list
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