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
def generate_csv(self):
if self.system_info:
systems = pd.read_csv(self.system_info)
ips = systems['Machine']
else:
system_info = {'192.168.92.18': ['3.7.7', '5.4.4', 'F30', '.local'],
'192.168.92.12': ['3.9.7', '5.4.4', 'F34', '.local'],
'192.168.93.51': ['3.7.7', '5.4.4', 'F30', 'venv'],
'192.168.92.15': ['3.6.6', '5.4.4', 'F27', '.local']}
ips = list(system_info.keys())
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')
ips = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15']
results = [pd.read_html('http://%s/html-reports/latest.html' % url, attrs={'id': 'myTable2'})[0] for url in ips]
systems = [pd.read_html('http://%s/html-reports/latest.html' % url, attrs={'id': 'SystemInformation'})[0] for
url in ips]
for df in range(0, len(ips)):
results[df]['IP'] = ips[df]
systems[df]['IP'] = ips[df]
dfs = [pd.merge(results[n], systems[n], on='IP') for n in range(len(ips))]
self.df = pd.concat(dfs)
self.df = self.df[self.df['STDOUT'] == 'STDOUT']
print(self.df['IP'].value_counts())
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(
drop=True)
system_variations = self.df[
['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname']].drop_duplicates(
['Python version', 'LANforge version', 'OS Version']).reset_index(drop=True)
errors = list()
for index in system_variations.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]
errors.append(result)
system_variations['errors'] = errors