Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin-telecom
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
1
Merge Requests
1
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
Paul Graydon
wendelin-telecom
Commits
74575586
Commit
74575586
authored
Apr 03, 2023
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/__init__.py: init test
parent
450cfa15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
tests/__init__.py
tests/__init__.py
+55
-0
No files found.
tests/__init__.py
0 → 100644
View file @
74575586
from
glob
import
glob
import
os
,
subprocess
,
re
import
sys
from
test_suite
import
ERP5TypeTestSuite
class
ORSWendelin
(
ERP5TypeTestSuite
):
"""
"""
def
setup
(
self
):
ERP5TypeTestSuite
.
setup
(
self
)
return
self
.
runUnitTest
(
'--save'
,
'ors-wendelin:setup'
)
def
run
(
self
,
full_test
):
test
=
':'
in
full_test
and
full_test
.
split
(
':'
)[
1
]
or
full_test
if
test
.
startswith
(
'testFunctional'
):
return
self
.
_updateFunctionalTestResponse
(
self
.
runUnitTest
(
'--load'
,
full_test
))
return
self
.
runUnitTest
(
'--load'
,
full_test
)
def
getTestList
(
self
):
test_list
=
[]
path
=
sys
.
path
[
0
]
component_re
=
re
.
compile
(
".*/([^/]+)/TestTemplateItem/portal_components"
"/test
\
.[^.]+
\
.([^.]+).py$"
)
for
test_path
in
(
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
]
# remove .py
test_list
.
append
(
test_case
)
return
test_list
def
_updateFunctionalTestResponse
(
self
,
status_dict
):
""" Convert the Unit Test output into more accurate information
related to funcional test run.
"""
# Parse relevant information to update response information
try
:
summary
,
html_test_result
=
status_dict
[
'stderr'
].
split
(
"-"
*
79
)[
1
:
3
]
except
ValueError
:
# In case of error when parse the file, preserve the original
# # informations. This prevents we have unfinished tests.
return
status_dict
status_dict
[
'html_test_result'
]
=
html_test_result
search
=
self
.
FTEST_PASS_FAIL_RE
.
search
(
summary
)
if
search
:
group_dict
=
search
.
groupdict
()
status_dict
[
'failure_count'
]
=
int
(
group_dict
[
'failures'
])
status_dict
[
'test_count'
]
=
int
(
group_dict
[
'total'
])
status_dict
[
'skip_count'
]
=
int
(
group_dict
[
'expected_failure'
])
return
status_dict
\ No newline at end of file
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