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
iv
erp5
Commits
21c1df7d
Commit
21c1df7d
authored
Dec 10, 2012
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve readability and make sure to remove all patch when needed
parent
d463d250
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+13
-8
No files found.
erp5/tests/testERP5TestNode.py
View file @
21c1df7d
...
@@ -400,8 +400,6 @@ branch = foo
...
@@ -400,8 +400,6 @@ branch = foo
def
test_11_run
(
self
):
def
test_11_run
(
self
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
pass
def
patch_killPrevious
():
pass
test_self
=
self
test_self
=
self
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
os
.
makedirs
(
test_result_path_root
)
os
.
makedirs
(
test_result_path_root
)
...
@@ -417,22 +415,21 @@ branch = foo
...
@@ -417,22 +415,21 @@ branch = foo
test_self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
test_self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
test_node
.
config
[
"working_directory"
],
x
)),
True
)
test_node
.
config
[
"working_directory"
],
x
)),
True
)
if
counter
==
0
:
if
counter
==
0
:
config_list
.
append
(
test_self
.
getTestSuiteData
()[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'foo'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bar'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bar'
)[
0
])
elif
counter
==
1
:
elif
counter
==
1
:
_checkExistingTestSuite
(
set
([
'foo'
]))
_checkExistingTestSuite
(
set
([
'foo'
]))
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bar'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bar'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
()[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'foo'
)[
0
])
elif
counter
==
2
:
elif
counter
==
2
:
_checkExistingTestSuite
(
set
([
'foo'
,
'bar'
]))
_checkExistingTestSuite
(
set
([
'foo'
,
'bar'
]))
config_list
.
append
(
test_self
.
getTestSuiteData
()[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'foo'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'qux'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'qux'
)[
0
])
elif
counter
==
3
:
elif
counter
==
3
:
_checkExistingTestSuite
(
set
([
'foo'
,
'qux'
]))
_checkExistingTestSuite
(
set
([
'foo'
,
'qux'
]))
test_node
.
process_manager
.
under_cancellation
=
True
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'foox'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'foox'
)[
0
])
elif
counter
==
4
:
elif
counter
==
4
:
test_node
.
process_manager
.
under_cancellation
=
False
_checkExistingTestSuite
(
set
([
'foox'
]))
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bax'
)[
0
])
config_list
.
append
(
test_self
.
getTestSuiteData
(
reference
=
'bax'
)[
0
])
elif
counter
==
5
:
elif
counter
==
5
:
_checkExistingTestSuite
(
set
([
'bax'
]))
_checkExistingTestSuite
(
set
([
'bax'
]))
...
@@ -442,6 +439,7 @@ branch = foo
...
@@ -442,6 +439,7 @@ branch = foo
def
patch_createTestResult
(
self
,
revision
,
test_name_list
,
node_title
,
def
patch_createTestResult
(
self
,
revision
,
test_name_list
,
node_title
,
allow_restart
=
False
,
test_title
=
None
,
project_title
=
None
):
allow_restart
=
False
,
test_title
=
None
,
project_title
=
None
):
global
counter
global
counter
# return no test to check if run method will run the next test suite
if
counter
==
3
and
project_title
!=
'qux'
:
if
counter
==
3
and
project_title
!=
'qux'
:
result
=
None
result
=
None
else
:
else
:
...
@@ -452,19 +450,26 @@ branch = foo
...
@@ -452,19 +450,26 @@ branch = foo
original_sleep
=
time
.
sleep
original_sleep
=
time
.
sleep
time
.
sleep
=
doNothing
time
.
sleep
=
doNothing
self
.
generateTestRepositoryList
()
self
.
generateTestRepositoryList
()
original_startTestSuite
=
TaskDistributor
.
startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
test_node
=
self
.
getTestNode
()
test_node
=
self
.
getTestNode
()
original_prepareSlapOS
=
test_node
.
_prepareSlapOS
test_node
.
_prepareSlapOS
=
doNothing
test_node
.
_prepareSlapOS
=
doNothing
original_runTestSuite
=
test_node
.
runTestSuite
test_node
.
runTestSuite
=
doNothing
test_node
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
test_node
.
process_manager
.
killPreviousRun
=
patch_killPrevious
try
:
try
:
test_node
.
run
()
test_node
.
run
()
except
Exception
as
e
:
except
Exception
as
e
:
self
.
assertEqual
(
type
(
e
),
StopIteration
)
self
.
assertEqual
(
type
(
e
),
StopIteration
)
finally
:
finally
:
time
.
sleep
=
original_sleep
time
.
sleep
=
original_sleep
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
test_node
.
_prepareSlapOS
=
original_prepareSlapOS
test_node
.
runTestSuite
=
original_runTestSuite
def
test_12_spawn
(
self
):
def
test_12_spawn
(
self
):
def
_checkCorrectStatus
(
expected_status
,
*
args
):
def
_checkCorrectStatus
(
expected_status
,
*
args
):
...
...
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