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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
072b7287
Commit
072b7287
authored
Oct 16, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_test_result: consider line without test as UNKNOWN result
parent
43a67746
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
1 deletion
+40
-1
bt5/erp5_test_result/TestTemplateItem/portal_components/test.erp5.testTaskDistribution.py
...eItem/portal_components/test.erp5.testTaskDistribution.py
+39
-0
bt5/erp5_test_result/WorkflowTemplateItem/portal_workflow/test_result_workflow/scripts/TestResult_complete.py
...kflow/test_result_workflow/scripts/TestResult_complete.py
+1
-1
No files found.
bt5/erp5_test_result/TestTemplateItem/portal_components/test.erp5.testTaskDistribution.py
View file @
072b7287
...
...
@@ -1421,6 +1421,45 @@ class TestTaskDistribution(TaskDistributionTestCase):
self
.
_createTestResult
(
test_title
=
'Periodicity Disabled Test Suite'
)
self
.
assertEqual
(
None
,
test_suite
.
getAlarmDate
())
class
TestRetryUnknownTest
(
TaskDistributionTestCase
):
"""Test how failed tests can be automatically retried.
"""
def
afterSetUp
(
self
):
super
(
TestRetryUnknownTest
,
self
).
afterSetUp
()
self
.
test_suite
,
=
self
.
test_suite_module
.
objectValues
()
self
.
_createTestNode
()
self
.
tic
()
def
test_unknown_test_with_zero_test_not_retried_by_default
(
self
):
test_result_path
,
_
=
self
.
_createTestResult
(
test_list
=
[
'testFoo'
,
])
test_result
=
self
.
portal
.
unrestrictedTraverse
(
test_result_path
)
line_url
,
_
=
self
.
tool
.
startUnitTest
(
test_result_path
)
test_result_line
=
self
.
portal
.
restrictedTraverse
(
line_url
)
status_dict
=
{
'test_count'
:
0
,
'error_count'
:
0
,
'failure_count'
:
0
,
}
self
.
tool
.
stopUnitTest
(
line_url
,
status_dict
)
self
.
tic
()
self
.
assertEqual
(
test_result_line
.
getStringIndex
(),
'UNKNOWN'
)
self
.
assertEqual
(
test_result_line
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
test_result
.
getStringIndex
(),
'FAIL'
)
self
.
assertEqual
(
test_result
.
getSimulationState
(),
'stopped'
)
def
test_unknown_test_without_status_not_retried_by_default
(
self
):
test_result_path
,
_
=
self
.
_createTestResult
(
test_list
=
[
'testFoo'
,
])
test_result
=
self
.
portal
.
unrestrictedTraverse
(
test_result_path
)
line_url
,
_
=
self
.
tool
.
startUnitTest
(
test_result_path
)
test_result_line
=
self
.
portal
.
restrictedTraverse
(
line_url
)
status_dict
=
{}
self
.
tool
.
stopUnitTest
(
line_url
,
status_dict
)
self
.
tic
()
self
.
assertEqual
(
test_result_line
.
getStringIndex
(),
'UNKNOWN'
)
self
.
assertEqual
(
test_result_line
.
getSimulationState
(),
'stopped'
)
self
.
assertEqual
(
test_result
.
getStringIndex
(),
'FAIL'
)
self
.
assertEqual
(
test_result
.
getSimulationState
(),
'stopped'
)
class
TestRetryFailedTest
(
TaskDistributionTestCase
):
"""Test how failed tests can be automatically retried.
...
...
bt5/erp5_test_result/WorkflowTemplateItem/portal_workflow/test_result_workflow/scripts/TestResult_complete.py
View file @
072b7287
...
...
@@ -63,7 +63,7 @@ elif test_result.getPortalType() == 'Test Result Line':
errors
=
kw
.
get
(
'error_count'
,
0
)
failures
=
kw
.
get
(
'failure_count'
,
0
)
skips
=
kw
.
get
(
'skip_count'
,
0
)
if
all_tests
is
None
:
if
(
all_tests
is
None
)
or
(
all_tests
==
0
)
:
status
=
'UNKNOWN'
all_tests
=
0
elif
errors
or
failures
and
unexpected
(
test_result
.
getParentValue
()):
...
...
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