Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
792a4370
Commit
792a4370
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Added not testable status code (refs
#20453
).
parent
d644fafd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tester.py
+18
-15
18 additions, 15 deletions
tester.py
with
18 additions
and
15 deletions
tester.py
+
18
−
15
View file @
792a4370
...
...
@@ -157,27 +157,30 @@ class Tester():
for
name
,
description
,
command
in
tests
:
log
(
'
\033
[1;95m-- Test
"
%s
"
--
\033
[0;0m
'
%
name
)
# Run test
try
:
p
=
subprocess
.
Popen
(
command
,
stdin
=
sys
.
stdin
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
out
,
err
=
p
.
communicate
()
if
out
:
log
(
out
.
decode
(
'
utf-8
'
).
strip
())
if
err
:
log
(
err
.
decode
(
'
utf-8
'
).
strip
())
if
p
.
returncode
!=
0
:
raise
Exception
(
'
Command exited with code %s.
'
%
p
.
returncode
)
except
Exception
as
e
:
exit_code
=
1
log
(
e
)
results
.
append
((
name
,
description
,
command
,
False
))
p
=
subprocess
.
Popen
(
command
,
stdin
=
sys
.
stdin
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
out
,
err
=
p
.
communicate
()
if
out
:
log
(
out
.
decode
(
'
utf-8
'
).
strip
())
if
err
:
log
(
err
.
decode
(
'
utf-8
'
).
strip
())
if
p
.
returncode
==
0
:
success
=
True
elif
p
.
returncode
==
2
:
success
=
None
else
:
results
.
append
((
name
,
description
,
command
,
True
))
success
=
False
exit_code
=
1
log
(
'
Command exited with code %s.
'
%
p
.
returncode
)
results
.
append
((
name
,
description
,
command
,
success
))
# Display results
log
(
'
\n
Tests results:
'
)
html_report
=
'
<table border=
"
1
"
>
'
html_report
+=
'
\n
<tr><th>Test</th><th>Result</th><th>Description</th></tr>
'
for
name
,
description
,
command
,
success
in
results
:
if
success
:
if
success
is
None
:
html_result
=
'
<span style=
"
color: blue;
"
>not testable</span>
'
term_result
=
'
\033
[94mnot testable
\033
[0m
'
elif
success
:
html_result
=
'
<span style=
"
color: green;
"
>success</span>
'
term_result
=
'
\033
[92msuccess
\033
[0m
'
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment