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
65ba3a5f
Commit
65ba3a5f
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Changed results display (refs
#20653
).
parent
77d99695
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tester.py
+23
-14
23 additions, 14 deletions
tester.py
with
23 additions
and
14 deletions
tester.py
+
23
−
14
View file @
65ba3a5f
...
@@ -215,30 +215,39 @@ class Tester():
...
@@ -215,30 +215,39 @@ class Tester():
report_rows_length
=
[
max
(
len
(
strip_colors
(
t
)),
report_rows_length
[
i
])
for
i
,
t
in
enumerate
(
report_rows
[
-
1
])]
report_rows_length
=
[
max
(
len
(
strip_colors
(
t
)),
report_rows_length
[
i
])
for
i
,
t
in
enumerate
(
report_rows
[
-
1
])]
exit_code
=
1
if
failures
>
0
else
0
exit_code
=
1
if
failures
>
0
else
0
# Display results
# Display results
# results as text
log
(
'
\n
Tests results:
'
)
log
(
'
\n
Tests results:
'
)
html_report
=
'
<table border=
"
1
"
>
'
log_report
=
''
log_report
=
''
for
row
in
report_rows
:
for
row
in
report_rows
:
is_header
=
not
log_report
if
not
log_report
:
html_cell
=
'
th
'
if
is_header
else
'
td
'
log_report
+=
'
-
'
*
50
for
i
,
val
in
enumerate
(
row
):
if
i
==
len
(
row
)
-
1
:
break
if
i
==
0
:
# merge name and description
log_report
+=
'
\n\033
[95;1m%s
\033
[0;0m
\033
[90m%s
\033
[0m
\n
'
%
(
val
,
row
[
-
1
])
else
:
nb_sp
=
report_rows_length
[
i
]
-
len
(
strip_colors
(
val
))
log_report
+=
'
%s%s
'
%
(
val
,
'
'
*
nb_sp
)
log_report
+=
'
\n
'
+
'
-
'
*
50
log
(
log_report
.
strip
())
log
(
'
Total tests duration: %s.
\n
'
%
total_duration
)
# results as html
html_report
=
''
for
row
in
report_rows
:
html_cell
=
'
th
'
if
not
html_report
else
'
td
'
html_report
+=
'
\n
<tr>
'
html_report
+=
'
\n
<tr>
'
log_report
+=
'
\n
|
'
for
i
,
val
in
enumerate
(
row
):
for
i
,
val
in
enumerate
(
row
):
html_report
+=
'
<%s>%s</%s>
'
%
(
html_cell
,
val
,
html_cell
)
html_report
+=
'
<%s>%s</%s>
'
%
(
html_cell
,
val
,
html_cell
)
nb_sp
=
len
(
strip_colors
(
val
).
center
(
report_rows_length
[
i
]))
-
len
(
strip_colors
(
val
))
log_report
+=
'
%s%s |
'
%
(
val
,
'
'
*
nb_sp
)
html_report
+=
'
</tr>
'
html_report
+=
'
</tr>
'
if
is_header
:
html_report
=
'
<table border=
"
1
"
>%s
\n
</table>
'
%
html_report
log_report
+=
'
\n
|
'
html_report
=
html_report
.
replace
(
'
\033
[90m
'
,
'
<span style=
"
color: gray;
"
>
'
)
for
i
,
val
in
enumerate
(
row
):
log_report
+=
'
%s|
'
%
(
'
-
'
*
(
report_rows_length
[
i
]
+
2
))
log
(
log_report
.
strip
())
log
(
'
Total tests duration: %s.
\n
'
%
total_duration
)
html_report
+=
'
\n
</table>
'
html_report
=
html_report
.
replace
(
'
\033
[91m
'
,
'
<span style=
"
color: red;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[91m
'
,
'
<span style=
"
color: red;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[92m
'
,
'
<span style=
"
color: green;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[92m
'
,
'
<span style=
"
color: green;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[94m
'
,
'
<span style=
"
color: blue;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[93m
'
,
'
<span style=
"
color: orange;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[93m
'
,
'
<span style=
"
color: orange;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[94m
'
,
'
<span style=
"
color: blue;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[95m
'
,
'
<span style=
"
color: purple;
"
>
'
)
html_report
=
html_report
.
replace
(
'
\033
[0m
'
,
'
</span>
'
)
html_report
=
html_report
.
replace
(
'
\033
[0m
'
,
'
</span>
'
)
# Store locally results
# Store locally results
now
=
datetime
.
datetime
.
utcnow
()
now
=
datetime
.
datetime
.
utcnow
()
...
...
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