mine_regression_results: Take advantage of the updates to regression reports which include system information

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2021-12-07 17:56:32 -08:00
parent 828ce68532
commit 1f7ca179e8

View File

@@ -12,31 +12,26 @@ class MineRegression:
self.save_csv = save_csv self.save_csv = save_csv
def generate_csv(self): def generate_csv(self):
if self.system_info: ips = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15']
systems = pd.read_csv(self.system_info) results = [pd.read_html('http://%s/html-reports/latest.html' % url, attrs={'id': 'myTable2'})[0] for url in ips]
ips = systems['Machine'] systems = [pd.read_html('http://%s/html-reports/latest.html' % url, attrs={'id': 'SystemInformation'})[0] for
else: url in ips]
system_info = {'192.168.92.18': ['3.7.7', '5.4.4', 'F30', '.local'], for df in range(0, len(ips)):
'192.168.92.12': ['3.9.7', '5.4.4', 'F34', '.local'], results[df]['IP'] = ips[df]
'192.168.93.51': ['3.7.7', '5.4.4', 'F30', 'venv'], systems[df]['IP'] = ips[df]
'192.168.92.15': ['3.6.6', '5.4.4', 'F27', '.local']} dfs = [pd.merge(results[n], systems[n], on='IP') for n in range(len(ips))]
ips = list(system_info.keys()) self.df = pd.concat(dfs)
systems = pd.DataFrame(system_info).transpose().reset_index()
systems.columns = ['Machine', 'Python version', 'LF version', 'Fedora version', 'environment']
results = [pd.read_html('http://%s/html-reports/latest.html' % url)[0] for url in ips]
for result in list(range(0, len(ips))):
results[result]['Machine'] = ips[result]
self.df = pd.concat(results)
self.df = pd.merge(self.df, systems, on='Machine')
self.df = self.df[self.df['STDOUT'] == 'STDOUT'] self.df = self.df[self.df['STDOUT'] == 'STDOUT']
print(self.df['IP'].value_counts())
def generate_report(self): def generate_report(self):
system_variations = self.df[['Machine', 'Python version', 'LF version', 'Fedora version', 'environment']].drop_duplicates(['Python version', 'LF version', 'Fedora version', 'environment']).reset_index( system_variations = self.df[
drop=True) ['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname']].drop_duplicates(
['Python version', 'LANforge version', 'OS Version']).reset_index(drop=True)
errors = list() errors = list()
for index in system_variations.index: for index in system_variations.index:
variation = system_variations.iloc[index] variation = system_variations.iloc[index]
result = self.df.loc[self.df[['Python version', 'LF version', 'Fedora version', 'environment']].isin(dict( result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version']].isin(dict(
variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0] variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0]
errors.append(result) errors.append(result)
system_variations['errors'] = errors system_variations['errors'] = errors