Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos-caddy
Commits
4a236935
Commit
4a236935
authored
Apr 19, 2017
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve try information formatting
parent
c4c881e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
software/cdn-test/runTestSuite.py
software/cdn-test/runTestSuite.py
+16
-16
No files found.
software/cdn-test/runTestSuite.py
View file @
4a236935
...
...
@@ -87,7 +87,7 @@ def main():
result_found
=
False
while
1
:
finished
=
False
try_info
=
'Try %s/%s
.
'
%
(
try_num
,
TRY_AMOUNT
)
try_info
=
'Try %s/%s
:
'
%
(
try_num
,
TRY_AMOUNT
)
test_result_glob
=
os
.
path
.
join
(
args
.
partition_path
,
'..'
,
...
...
@@ -96,27 +96,27 @@ def main():
'public'
,
'test-script-result'
,
)
print
(
try_info
+
'
Waiting for data in %r.'
%
(
test_result_glob
,))
print
(
try_info
+
'Waiting for data in %r.'
%
(
test_result_glob
,))
result_list
=
glob
.
glob
(
test_result_glob
)
if
len
(
result_list
)
>
0
:
print
(
try_info
+
'
Data directory found, looking for results.'
)
print
(
try_info
+
'Data directory found, looking for results.'
)
result_path
=
result_list
[
0
]
result_file_list
=
list
((
os
.
path
.
join
(
dirname
,
filename
)
for
dirname
,
dirnames
,
filenames
in
os
.
walk
(
result_path
)
for
filename
in
filenames
))
if
len
(
result_file_list
):
print
(
try_info
+
'
No result posted, will check next try.'
)
print
(
try_info
+
'No result posted, will check next try.'
)
for
result_file
in
result_file_list
:
print
(
try_info
+
'
Data found.'
)
print
(
try_info
+
'Data found.'
)
result_found
=
True
result_file
=
os
.
path
.
abspath
(
result_file
)
status_dict
[
'command'
]
=
result_file
result
=
open
(
result_file
).
read
()
# remove result, as it is not required anymore
os
.
unlink
(
result_file
)
print
(
try_info
+
'
Analysis of result %r:'
%
(
result_file
,))
print
(
try_info
+
' '
+
result
)
print
(
try_info
+
'Analysis of result %r:'
%
(
result_file
,))
print
(
try_info
+
result
)
status_dict
[
'stderr'
]
=
'Last result:
\
n
%s'
%
(
result
,)
if
'FATAL: all hosts have already failed -- aborting'
in
result
:
# failed
...
...
@@ -127,8 +127,8 @@ def main():
error_count
=
0
)
finished
=
False
status_dict
[
'stdout'
]
=
try_info
+
'
Build not yet successful.'
print
(
try_info
+
'
%r: Found not yet finished run.'
%
(
result_file
,))
status_dict
[
'stdout'
]
=
try_info
+
'Build not yet successful.'
print
(
try_info
+
'%r: Found not yet finished run.'
%
(
result_file
,))
elif
"
\
"
msg
\
"
:
\
"
[u'Build successful, connect to:', u'"
in
result
:
# success
status_dict
.
update
(
...
...
@@ -138,8 +138,8 @@ def main():
error_count
=
0
)
finished
=
True
print
(
try_info
+
'
%r: Found finished successful run.'
%
(
result_file
,))
status_dict
[
'stdout'
]
=
try_info
+
'
Build successful.'
print
(
try_info
+
'%r: Found finished successful run.'
%
(
result_file
,))
status_dict
[
'stdout'
]
=
try_info
+
'Build successful.'
break
else
:
# unknown
...
...
@@ -150,22 +150,22 @@ def main():
error_count
=
1
)
status_dict
[
'stdout'
]
=
\
try_info
+
'
Cannot find success nor failure result in the output'
print
(
try_info
+
'
%r: Found unknown run.'
%
(
result_file
,))
try_info
+
'Cannot find success nor failure result in the output'
print
(
try_info
+
'%r: Found unknown run.'
%
(
result_file
,))
finished
=
False
if
finished
:
break
if
try_num
>=
TRY_AMOUNT
:
msg
=
try_info
+
'
Time exceeded, success not found.'
msg
=
try_info
+
'Time exceeded, success not found.'
print
(
msg
)
status_dict
.
setdefault
(
'stdout'
,
''
)
status_dict
[
'stdout'
]
=
'
\
n
'
.
join
([
status_dict
[
'stdout'
],
msg
])
break
try_num
+=
1
print
(
try_info
+
'
Sleeping for %ss.'
%
(
SLEEP_TIME
,))
print
(
try_info
+
'Sleeping for %ss.'
%
(
SLEEP_TIME
,))
sleep
(
SLEEP_TIME
)
if
not
result_found
:
status_dict
[
'stdout'
]
=
try_info
+
'
Test timed out and no result found.'
status_dict
[
'stdout'
]
=
try_info
+
'Test timed out and no result found.'
status_dict
.
update
(
test_count
=
1
,
skip_count
=
0
,
...
...
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