Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Platform Validation
Commits
b232c840
Commit
b232c840
authored
Oct 04, 2021
by
Denis Karpenok (EPAM)
Browse files
Badges
parent
267c11ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Summarize_Newman_Html_Reports.py
View file @
b232c840
...
...
@@ -6,6 +6,7 @@ from time import strftime, gmtime
from
openpyxl
import
Workbook
,
load_workbook
from
bs4
import
BeautifulSoup
as
BS
from
pybadges
import
badge
from
openpyxl.styles
import
Font
,
PatternFill
,
Alignment
...
...
@@ -116,22 +117,30 @@ for env in envs:
if
failed
==
'N/C'
:
pass_rate
=
'N/C'
badgeColor
=
'#e05d44'
elif
failed
==
0
:
pass_rate
=
100
result_data
.
cell
(
ordered_collections
[
html_report
.
split
(
'.'
)[
1
]],
5
+
env_columns
).
font
=
\
Font
(
color
=
'00339966'
,
bold
=
True
)
badgeColor
=
'#4c1'
else
:
pass_rate
=
round
((
executed
-
failed
)
*
100
/
executed
,
2
)
if
pass_rate
<
60
:
result_data
.
cell
(
ordered_collections
[
html_report
.
split
(
'.'
)[
1
]],
5
+
env_columns
).
font
=
\
Font
(
color
=
'00FF0000'
,
bold
=
True
)
badgeColor
=
'#e05d44'
# red
else
:
result_data
.
cell
(
ordered_collections
[
html_report
.
split
(
'.'
)[
1
]],
5
+
env_columns
).
font
=
Font
(
bold
=
True
)
badgeColor
=
'#dfb317'
result_data
.
cell
(
ordered_collections
[
html_report
.
split
(
'.'
)[
1
]],
5
+
env_columns
).
value
=
pass_rate
result_data
.
cell
(
ordered_collections
[
html_report
.
split
(
'.'
)[
1
]],
5
+
env_columns
).
alignment
=
\
Alignment
(
horizontal
=
'center'
)
with
open
(
env
+
'.svg'
,
'w'
)
as
f
:
f
.
write
(
badge
(
left_text
=
env
,
right_text
=
(
'%.1f%%'
%
pass_rate
),
right_color
=
badgeColor
))
"""
raw_data_csv_file = '../pass_rate/raw_data.csv'
headers = ['Collection', 'Date', 'Time', 'Env', 'Requests', 'Pass', 'Fail', 'Pass Rate', 'Service Version',
...
...
Write
Preview
Supports
Markdown
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