Commit b232c840 authored by Denis Karpenok (EPAM)'s avatar Denis Karpenok (EPAM)
Browse files

Badges

parent 267c11ca
......@@ -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',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment