mine_regression_results: Support Python environment control variable

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2021-12-08 14:57:07 -08:00
parent edadf4f545
commit 3201ee1e80

View File

@@ -23,18 +23,32 @@ class MineRegression:
dfs = [pd.merge(results[n], systems[n], on='IP') for n in range(len(self.ips))]
self.df = pd.concat(dfs)
self.df = self.df[self.df['STDOUT'] == 'STDOUT']
print(self.df.columns)
def generate_report(self):
system_variations = self.df[
['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname']].drop_duplicates(
['Python version', 'LANforge version', 'OS Version']).reset_index(drop=True)
['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']].drop_duplicates(
['IP', 'Python version', 'LANforge version', 'OS Version', 'Hostname', 'Python Environment']).reset_index(drop=True)
print(self.df.drop_duplicates('IP'))
print(self.df['IP'].value_counts())
print(system_variations['IP'].value_counts())
errors = list()
lanforge_errors = list()
for index in system_variations.index:
print(system_variations['IP'][index])
variation = system_variations.iloc[index]
result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version']].isin(dict(
result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict(
variation).values()).all(axis=1), :].dropna(subset=['STDERR']).shape[0]
print(result)
errors.append(result)
lanforge_result = self.df.loc[self.df[['Python version', 'LANforge version', 'OS Version', 'Python Environment', 'IP']].isin(dict(
variation).values()).all(axis=1), :].dropna(subset=['LANforge Error']).shape[0]
print(result)
lanforge_errors.append(lanforge_result)
system_variations['errors'] = errors
system_variations['LANforge errors'] = lanforge_errors
system_variations['Python errors'] = system_variations['errors'] - system_variations['LANforge errors']
if self.save_csv:
system_variations.to_csv('regression_suite_results.csv')
else:
@@ -50,7 +64,7 @@ def main():
if args.ip is None:
args.ip = ['192.168.92.18', '192.168.92.12', '192.168.93.51', '192.168.92.15']
#args.ip = ['192.168.93.51']
Miner = MineRegression(system_information=args.system_info,
save_csv=args.save_csv,
ips=args.ip)