Skip to content

Commit

Permalink
add coverage report link to metrics page
Browse files Browse the repository at this point in the history
update link style
  • Loading branch information
rayz committed Mar 26, 2018
1 parent e02167f commit 488b492
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions verif/tools/run_new_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,22 +299,29 @@ def coverage_div(self, x_axis={}, y_axis={}):
divs[proj][regr] = div
return divs

def regr_table_div(self, regr_sts_db={}):
def regr_table_div(self, regr_sts_db={}, db_dir=''):
divs = {}
for proj in self._proj_regr_dict:
divs[proj] = {}
for regr in self._proj_regr_dict[proj]:
ROW = []
db = regr_sts_db[proj][regr]
for idx in range(len(db)):
item = {}
item['Name'] = '_'.join((proj,regr))
item['Date'] = db[idx]['start_time']
item['Seed'] = db[idx]['plan_seed']
item['CommitID'] = db[idx]['unique_id'][0:10]
item['Status'] = db[idx]['status']
item['Cov'] = 'Func:{:.2%} Code:{:.2%}'.format(db[idx]['metrics_result']['functional_coverage'],db[idx]['metrics_result']['code_coverage'])
item['PassingRate'] = dcc.Link('{:.2%}'.format(db[idx]['metrics_result']['passing_rate']), href=db[idx]['start_time'])
item = {}
item['Name'] = '_'.join((proj,regr))
item['Date'] = db[idx]['start_time']
item['Seed'] = db[idx]['plan_seed']
item['CommitID'] = db[idx]['unique_id'][0:10]
item['Status'] = db[idx]['status']
cov_file = os.path.join(db_dir,proj,regr,'coverage','urgReport_'+db[idx]['start_time'],'dashboard.html')
if os.path.exists(cov_file):
item['Cov'] = html.A('Func:{:.2%} Code:{:.2%}'.format(db[idx]['metrics_result']['functional_coverage'],db[idx]['metrics_result']['code_coverage']),
href = 'https://nvtegra/'+cov_file)
else:
item['Cov'] = 'Func:{:.2%} Code:{:.2%}'.format(db[idx]['metrics_result']['functional_coverage'],db[idx]['metrics_result']['code_coverage'])
item['PassingRate'] = dcc.Link('{:.2%}'.format(db[idx]['metrics_result']['passing_rate']),
href = db[idx]['start_time'],
style = {'color':'green','textDecoration':'underline','cursor':'pointer'})
ROW.append(item)
ROW = sorted(ROW, key=lambda k:k['Date'])
ROW.reverse()
Expand Down Expand Up @@ -526,7 +533,7 @@ def dash_gen(self, project=[], x_axis={}, y_axis={}, regr_sts_db={}, test_db_fil
passing_rate_divs = self.passing_rate_div(x_axis,y_axis)
test_num_divs = self.test_num_div(x_axis,y_axis)
coverage_divs = self.coverage_div(x_axis,y_axis)
regr_table_divs = self.regr_table_div(regr_sts_db)
regr_table_divs = self.regr_table_div(regr_sts_db,db_dir)
syndrome_table_divs = self.syndrome_table_div(test_db_files, synd_db)
test_table_divs = self.test_table_div(test_db_files)
syndrome_div = self.syndrome_div(synd_db)
Expand Down Expand Up @@ -671,7 +678,6 @@ def display_content(selected_proj):
else:
return []


# Add a static image route that serves images from desktop
@self._app.server.route('{}<image_path>.png'.format('/static/'))
def serve_image(image_path):
Expand Down Expand Up @@ -727,7 +733,8 @@ def display_page(pathname):
test_table_divs[self._proj][self._regr][table_name],
html.Div(
children = [
html.A('BACK', href='/nvdla', style={'color':'green'}),
#html.A('BACK', href='/nvdla', style={'color':'green'}),
dcc.Link('BACK', href='/nvdla', style={'color':'green','textDecoration':'underline','cursor':'pointer'}),
],
style = {
'float' : 'left',
Expand Down

0 comments on commit 488b492

Please sign in to comment.