test: add output tables to autotest_post.py
These output tables will help show graphically which tests are being run where, and which ones are being tested with ASAN and UBSAN enabled. Change-Id: Ia11657d4468f1ed41ab13b3241893ce09e949668 Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/421556 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
194b8eca98
commit
df531e7faf
@ -6,6 +6,30 @@ import argparse
|
|||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
import re
|
import re
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
|
def highest_value(inp):
|
||||||
|
ret_value = False
|
||||||
|
for x in inp:
|
||||||
|
if x:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def generateTestCompletionTables(output_dir, completion_table):
|
||||||
|
data_table = pd.DataFrame(completion_table, columns=["Agent", "Test", "With Asan", "With UBsan"])
|
||||||
|
data_table.to_html(os.path.join(output_dir, 'completions_table.html'))
|
||||||
|
|
||||||
|
pivot_by_agent = pd.pivot_table(data_table, index=["Agent", "Test"])
|
||||||
|
pivot_by_agent.to_html(os.path.join(output_dir, 'completions_table_by_agent.html'))
|
||||||
|
pivot_by_test = pd.pivot_table(data_table, index=["Test", "Agent"])
|
||||||
|
pivot_by_test.to_html(os.path.join(output_dir, 'completions_table_by_test.html'))
|
||||||
|
pivot_by_asan = pd.pivot_table(data_table, index=["Test"], values=["With Asan"], aggfunc=highest_value)
|
||||||
|
pivot_by_asan.to_html(os.path.join(output_dir, 'completions_table_by_asan.html'))
|
||||||
|
pivot_by_ubsan = pd.pivot_table(data_table, index=["Test"], values=["With UBsan"], aggfunc=highest_value)
|
||||||
|
pivot_by_ubsan.to_html(os.path.join(output_dir, 'completions_table_by_ubsan.html'))
|
||||||
|
|
||||||
|
|
||||||
def generateCoverageReport(output_dir, repo_dir):
|
def generateCoverageReport(output_dir, repo_dir):
|
||||||
@ -71,6 +95,7 @@ def aggregateCompletedTests(output_dir, repo_dir):
|
|||||||
test_list = {}
|
test_list = {}
|
||||||
test_with_asan = {}
|
test_with_asan = {}
|
||||||
test_with_ubsan = {}
|
test_with_ubsan = {}
|
||||||
|
test_completion_table = []
|
||||||
asan_enabled = False
|
asan_enabled = False
|
||||||
ubsan_enabled = False
|
ubsan_enabled = False
|
||||||
test_unit_with_valgrind = False
|
test_unit_with_valgrind = False
|
||||||
@ -83,11 +108,13 @@ def aggregateCompletedTests(output_dir, repo_dir):
|
|||||||
if len(testFiles) == 0:
|
if len(testFiles) == 0:
|
||||||
print("Unable to perform test completion aggregator. No input files.")
|
print("Unable to perform test completion aggregator. No input files.")
|
||||||
return 0
|
return 0
|
||||||
for item in testFiles:
|
item = testFiles[0]
|
||||||
with open(item, 'r') as raw_test_list:
|
with open(item, 'r') as raw_test_list:
|
||||||
for line in raw_test_list:
|
for line in raw_test_list:
|
||||||
test_list[line.strip()] = (False, False, False)
|
test_list[line.strip()] = (False, False, False)
|
||||||
|
test_completion_table.append(["None", line.strip(), False, False])
|
||||||
for item in completionFiles:
|
for item in completionFiles:
|
||||||
|
agent_name = os.path.split(os.path.split(item)[0])[1]
|
||||||
with open(item, 'r') as completion_list:
|
with open(item, 'r') as completion_list:
|
||||||
completions = completion_list.read()
|
completions = completion_list.read()
|
||||||
|
|
||||||
@ -103,9 +130,15 @@ def aggregateCompletedTests(output_dir, repo_dir):
|
|||||||
|
|
||||||
if "valgrind" in completions and "unittest" in completions:
|
if "valgrind" in completions and "unittest" in completions:
|
||||||
test_unit_with_valgrind = True
|
test_unit_with_valgrind = True
|
||||||
|
test_completion_table.append([agent_name, "valgrind", asan_enabled, ubsan_enabled])
|
||||||
for line in completions.split('\n'):
|
for line in completions.split('\n'):
|
||||||
try:
|
try:
|
||||||
test_list[line.strip()] = (True, asan_enabled | test_list[line.strip()][1], ubsan_enabled | test_list[line.strip()][1])
|
test_list[line.strip()] = (True, asan_enabled | test_list[line.strip()][1], ubsan_enabled | test_list[line.strip()][1])
|
||||||
|
test_completion_table.append([agent_name, line.strip(), asan_enabled, ubsan_enabled])
|
||||||
|
try:
|
||||||
|
test_completion_table.remove(["None", line.strip(), False, False])
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
except KeyError:
|
except KeyError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -135,6 +168,8 @@ def aggregateCompletedTests(output_dir, repo_dir):
|
|||||||
with open(testSummary, 'r') as fh:
|
with open(testSummary, 'r') as fh:
|
||||||
print(fh.read())
|
print(fh.read())
|
||||||
|
|
||||||
|
generateTestCompletionTables(output_dir, test_completion_table)
|
||||||
|
|
||||||
|
|
||||||
def main(output_dir, repo_dir):
|
def main(output_dir, repo_dir):
|
||||||
generateCoverageReport(output_dir, repo_dir)
|
generateCoverageReport(output_dir, repo_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user