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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
2e1aac31
Commit
2e1aac31
authored
Mar 17, 2023
by
Jérome Perrin
Committed by
Arnaud Fontaine
Jul 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: disable tests that are not compatible with Python 3.
parent
a1d6a422
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
tests/__init__.py
tests/__init__.py
+22
-4
No files found.
tests/__init__.py
View file @
2e1aac31
...
@@ -4,6 +4,7 @@ import os, subprocess, re
...
@@ -4,6 +4,7 @@ import os, subprocess, re
# test_suite is provided by 'run_test_suite'
# test_suite is provided by 'run_test_suite'
from
test_suite
import
ERP5TypeTestSuite
from
test_suite
import
ERP5TypeTestSuite
import
sys
import
sys
import
six
from
itertools
import
chain
from
itertools
import
chain
HERE
=
os
.
path
.
dirname
(
__file__
)
HERE
=
os
.
path
.
dirname
(
__file__
)
...
@@ -46,6 +47,14 @@ class _ERP5(ERP5TypeTestSuite):
...
@@ -46,6 +47,14 @@ class _ERP5(ERP5TypeTestSuite):
component_re_match
.
group
(
2
))
component_re_match
.
group
(
2
))
else
:
else
:
test_case
=
test_path
.
split
(
os
.
sep
)[
-
1
][:
-
3
]
# remove .py
test_case
=
test_path
.
split
(
os
.
sep
)[
-
1
][:
-
3
]
# remove .py
if
six
.
PY3
:
# disable tests that are not compatible with Python 3.
if
test_case
in
(
# using legacy workflow
'erp5_workflow_test:testWorkflowAndDCWorkflow'
,
'testUpgradeInstanceWithOldDataFsLegacyWorkflow'
):
continue
product
=
test_path
.
split
(
os
.
sep
)[
-
3
]
product
=
test_path
.
split
(
os
.
sep
)[
-
3
]
# don't test 3rd party products
# don't test 3rd party products
if
product
in
(
'PortalTransforms'
,
'MailTemplates'
,
'Zelenium'
):
if
product
in
(
'PortalTransforms'
,
'MailTemplates'
,
'Zelenium'
):
...
@@ -231,15 +240,24 @@ class ERP5BusinessTemplateCodingStyleTestSuite(_ERP5):
...
@@ -231,15 +240,24 @@ class ERP5BusinessTemplateCodingStyleTestSuite(_ERP5):
"""Run coding style test on all business templates.
"""Run coding style test on all business templates.
"""
"""
def
getTestList
(
self
):
def
getTestList
(
self
):
def
skip_business_template
(
path
):
# we skip coding style check for business templates having this marker
# property. Since the property is not exported (on purpose), modified business templates
# will be candidate for coding style test again.
if
os
.
path
.
exists
(
path
+
'/bt/skip_coding_style_test'
):
return
True
if
six
.
PY3
and
os
.
path
.
basename
(
path
)
in
(
'erp5_workflow_test'
,
# uses legacy DCWorkflow
):
return
True
return
False
test_list
=
[
test_list
=
[
os
.
path
.
basename
(
path
)
os
.
path
.
basename
(
path
)
for
path
in
chain
(
for
path
in
chain
(
glob
(
HERE
+
'/../bt5/*'
),
glob
(
HERE
+
'/../bt5/*'
),
glob
(
HERE
+
'/../product/ERP5/bootstrap/*'
))
glob
(
HERE
+
'/../product/ERP5/bootstrap/*'
))
# we skip coding style check for business templates having this marker
if
os
.
path
.
isdir
(
path
)
and
not
skip_business_template
(
path
)
# property. Since the property is not exported (on purpose), modified business templates
# will be candidate for coding style test again.
if
not
os
.
path
.
exists
(
path
+
'/bt/skip_coding_style_test'
)
and
os
.
path
.
isdir
(
path
)
]
]
for
path
in
chain
(
glob
(
HERE
+
'/../product/*'
),
for
path
in
chain
(
glob
(
HERE
+
'/../product/*'
),
glob
(
HERE
+
'/../bt5'
)):
glob
(
HERE
+
'/../bt5'
)):
...
...
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