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
Carlos Ramos Carreño
erp5
Commits
ee12673f
Commit
ee12673f
authored
Sep 10, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: Fail test when error during SR install/runing test
parent
a31d90bb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
12 deletions
+23
-12
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+4
-6
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+19
-6
No files found.
erp5/util/testnode/ScalabilityTestRunner.py
View file @
ee12673f
...
@@ -384,7 +384,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -384,7 +384,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
node_test_suite
.
project_title
)
node_test_suite
.
project_title
)
count
=
0
count
=
0
error
=
None
error
_message
=
None
# Each cluster configuration are tested
# Each cluster configuration are tested
for
configuration
in
configuration_list
:
for
configuration
in
configuration_list
:
...
@@ -419,7 +419,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -419,7 +419,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
#
#
if
test_result_line_proxy
==
None
:
if
test_result_line_proxy
==
None
:
error_message
=
"Test case already tested."
error_message
=
"Test case already tested."
error
=
ValueError
(
error_message
)
break
break
self
.
log
(
"Test for count : %d is in a running state."
%
count
)
self
.
log
(
"Test for count : %d is in a running state."
%
count
)
...
@@ -435,7 +434,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -435,7 +434,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
if
test_result_line_proxy
.
isTestCaseAlive
():
if
test_result_line_proxy
.
isTestCaseAlive
():
error_message
=
"Test case during for %s seconds, too long. (max: %s seconds). Test failure."
\
error_message
=
"Test case during for %s seconds, too long. (max: %s seconds). Test failure."
\
%
(
str
(
time
.
time
()
-
test_case_start_time
),
MAX_TEST_CASE_TIME
)
%
(
str
(
time
.
time
()
-
test_case_start_time
),
MAX_TEST_CASE_TIME
)
error
=
ValueError
(
error_message
)
test_result_proxy
.
reportFailure
(
stdout
=
error_message
)
test_result_proxy
.
reportFailure
(
stdout
=
error_message
)
break
break
...
@@ -446,7 +444,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -446,7 +444,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
break
break
# Cancelled or in an undeterminate state.
# Cancelled or in an undeterminate state.
error_message
=
"Test cancelled or undeterminate state."
error_message
=
"Test cancelled or undeterminate state."
error
=
ValueError
(
error_message
)
break
break
# Stop current instance
# Stop current instance
...
@@ -457,9 +454,10 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -457,9 +454,10 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
_cleanUpOldInstance
()
self
.
_cleanUpOldInstance
()
# If error appears then that's a test failure.
# If error appears then that's a test failure.
if
error
:
if
error
_message
:
test_result_proxy
.
fail
()
test_result_proxy
.
fail
()
raise
error
self
.
log
(
"Test Failed."
)
return
{
'status_code'
:
1
,
'error_message'
:
error_message
}
# Test is finished.
# Test is finished.
self
.
log
(
"Test finished."
)
self
.
log
(
"Test finished."
)
return
{
'status_code'
:
0
}
return
{
'status_code'
:
0
}
...
...
erp5/util/testnode/testnode.py
View file @
ee12673f
...
@@ -390,17 +390,30 @@ from the distributor.")
...
@@ -390,17 +390,30 @@ from the distributor.")
# Give some time so computer partitions may start
# Give some time so computer partitions may start
# as partitions can be of any kind we have and likely will never have
# as partitions can be of any kind we have and likely will never have
# a reliable way to check if they are up or not ...
# a reliable way to check if they are up or not ...
#
time.sleep(20)
time
.
sleep
(
20
)
if
my_test_type
==
'UnitTest'
:
if
my_test_type
==
'UnitTest'
:
runner
.
runTestSuite
(
node_test_suite
,
portal_url
)
runner
.
runTestSuite
(
node_test_suite
,
portal_url
)
elif
my_test_type
==
'ScalabilityTest'
:
error_message
=
None
# A problem is appeared during runTestSuite
if
status_dict
[
'status_code'
]
==
1
:
error_message
=
"Software installation too long or error(s) are present during SR install."
else
:
else
:
if
status_dict
[
'status_code'
]
==
0
:
status_dict
=
runner
.
runTestSuite
(
node_test_suite
,
portal_url
)
runner
.
runTestSuite
(
node_test_suite
,
portal_url
)
# A problem is appeared during runTestSuite
else
:
if
status_dict
[
'status_code'
]
==
1
:
error_message
=
status_dict
[
'error_message'
]
# If an error is appeared
if
error_message
:
test_result
.
reportFailure
(
test_result
.
reportFailure
(
command
=
"runner.prepareSlapOSForTestSuite()"
,
stdout
=
error_message
stdout
=
"Software installation too long or error(s) are present."
)
)
self
.
log
(
error_message
)
raise
ValueError
(
error_message
)
else
:
raise
NotImplementedError
# break the loop to get latest priorities from master
# break the loop to get latest priorities from master
break
break
self
.
cleanUp
(
test_result
)
self
.
cleanUp
(
test_result
)
...
...
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