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
Klaus Wölfel
erp5
Commits
faa6705c
Commit
faa6705c
authored
Nov 24, 2016
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_test_result: avoid useless failures when a test suite is invalidated
parent
037b5f10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
bt5/erp5_test_result/TestTemplateItem/portal_components/test.erp5.testTaskDistribution.py
...eItem/portal_components/test.erp5.testTaskDistribution.py
+4
-0
product/ERP5/Document/ERP5ProjectUnitTestDistributor.py
product/ERP5/Document/ERP5ProjectUnitTestDistributor.py
+14
-9
No files found.
bt5/erp5_test_result/TestTemplateItem/portal_components/test.erp5.testTaskDistribution.py
View file @
faa6705c
...
...
@@ -512,6 +512,10 @@ class TestTaskDistribution(ERP5TypeTestCase):
self
.
assertEquals
(
'{"configuration_list": [{}]}'
,
self
.
distributor
.
generateConfiguration
(
test_suite
.
getTitle
()))
test_suite
.
setClusterConfiguration
(
'{"foo": 3}'
)
self
.
assertEquals
(
'{"configuration_list": [{"foo": 3}]}'
,
self
.
distributor
.
generateConfiguration
(
test_suite
.
getTitle
()))
# make sure generateConfiguration does not fail if test suite is invalidated
test_suite
.
invalidate
()
self
.
tic
()
self
.
assertEquals
(
'{"configuration_list": [{}]}'
,
self
.
distributor
.
generateConfiguration
(
test_suite
.
getTitle
()))
def
_checkTestSuiteAggregateList
(
self
,
*
args
):
self
.
tic
()
...
...
product/ERP5/Document/ERP5ProjectUnitTestDistributor.py
View file @
faa6705c
...
...
@@ -391,8 +391,9 @@ class ERP5ProjectUnitTestDistributor(XMLObject):
test_node
=
self
.
_getTestNodeFromTitle
(
node_title
)
test_node
.
setPingDate
()
test_suite
=
self
.
_getTestSuiteFromTitle
(
name
)
test_suite
.
setPingDate
()
return
portal
.
portal_task_distribution_tool
.
createTestResult
(
name
,
if
test_suite
is
not
None
:
test_suite
.
setPingDate
()
return
portal
.
portal_task_distribution_tool
.
createTestResult
(
name
,
revision
,
test_name_list
,
allow_restart
,
test_title
=
title_title
,
node_title
=
node_title
,
project_title
=
project_title
)
...
...
@@ -412,9 +413,11 @@ class ERP5ProjectUnitTestDistributor(XMLObject):
portal_type
=
'Test Suite'
,
title
=
SimpleQuery
(
comparison_operator
=
'='
,
title
=
suite_title
),
validation_state
=
'validated'
)
assert
len
(
test_suite_list
)
=
=
1
,
"We found %i test suite for %s"
%
(
assert
len
(
test_suite_list
)
<
=
1
,
"We found %i test suite for %s"
%
(
len
(
test_suite_list
),
suite_title
)
test_suite
=
test_suite_list
[
0
].
getObject
()
test_suite
=
None
if
len
(
test_suite_list
):
test_suite
=
test_suite_list
[
0
].
getObject
()
return
test_suite
security
.
declarePublic
(
"startUnitTest"
)
...
...
@@ -445,11 +448,13 @@ class ERP5ProjectUnitTestDistributor(XMLObject):
always return a list.
"""
test_suite
=
self
.
_getTestSuiteFromTitle
(
test_suite_title
)
cluster_configuration
=
test_suite
.
getClusterConfiguration
()
or
'{}'
try
:
generated_configuration
=
{
"configuration_list"
:
[
json
.
loads
(
cluster_configuration
)]}
except
ValueError
:
generated_configuration
=
{
"configuration_list"
:
[{}]}
generated_configuration
=
{
"configuration_list"
:
[{}]}
if
test_suite
is
not
None
:
cluster_configuration
=
test_suite
.
getClusterConfiguration
()
or
'{}'
try
:
generated_configuration
=
{
"configuration_list"
:
[
json
.
loads
(
cluster_configuration
)]}
except
ValueError
:
pass
if
batch_mode
:
return
generated_configuration
return
json
.
dumps
(
generated_configuration
)
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