14 def run(self, test: WorkflowTest) -> bool:
15 result = True
16 printed_trf = False
17 for step in test.steps:
18 self.logger.info("-----------------------------------------------------")
19 log = test.validation_path / f"log.{step}"
20 counter = 0
21 warnings = []
22 errors = []
23 if log.exists():
24 with log.open() as file:
25 for line in file:
26 if ("ERROR" in line and "| ERROR |" not in line) or ("FATAL" in line and "| FATAL |" not in line):
27 errors.append(line[9:].
strip())
28 elif "WARNING" in line and "| WARNING |" not in line:
29 warnings.append(line[9:].
strip())
30 elif '"successful run"' in line or step == "DQHistogramMerge" and "Writing file: myHIST.root" in line:
31 counter += 1
32
33 if warnings:
34 self.logger.info(f"{step} validation test step WARNINGS")
35 warnings = list(dict.fromkeys(warnings))
36 for w in warnings:
37 self.logger.info(f" {w}")
38 self.logger.info("-----------------------------------------------------")
39
40 if errors:
41 self.logger.info(f"{step} validation test step ERRORS")
42 errors = list(dict.fromkeys(errors))
43 for e in errors:
44 self.logger.info(f" {e}")
45 self.logger.info("-----------------------------------------------------")
46
47 if counter and not errors:
48 self.logger.info(f"{step} validation test step successful")
49
50 if step == "DQHistogramMerge":
51 self.logger.info(f"Full {step} step log:")
52 with log.open() as file:
53 for line in file:
54 self.logger.
print(f
" {line.strip()}")
55 self.logger.info("-----------------------------------------------------")
56 else:
57 result = False
58 if log.exists():
59 printed_trf = True
60 self.logger.
error(f
"{step} validation test step failed")
61 self.logger.
error(f
"Full {step} step log:")
62 with log.open() as file:
63 for line in file:
64 self.logger.
print(f
" {line.strip()}")
65 self.logger.info("-----------------------------------------------------")
66 else:
67 self.logger.
error(f
"{step} validation test step did not run")
68 if not printed_trf:
69 printed_trf = True
70 self.logger.
error(
"Full transform log:")
71 with (test.validation_path / f"{test.ID}.log").open() as file:
72 for line in file:
73 self.logger.
print(f
" {line.strip()}")
74 self.logger.info("-----------------------------------------------------")
75
76 if self.setup.validation_only:
77 continue
78
79 log = test.reference_path / f"log.{step}"
80 counter = 0
81 with log.open() as file:
82 for line in file:
83 if '"successful run"' in line or (step == "DQHistogramMerge"
84 and "Writing file: myHIST.root" in line):
85 counter += 1
86
87 if counter:
88 self.logger.info(f"{step} reference test step successful")
89 else:
90 self.logger.
error(f
"{step} reference test step failed")
91 result = False
92
93 if result:
94 self.logger.info(f"All {test.ID} athena steps completed successfully\n")
95 else :
96 self.logger.
error(f
"One or more {test.ID} Athena steps failed. Please investigate the cause.\n")
97
98 return result
99
100
void print(char *figname, TCanvas *c1)
int run(int argc, char *argv[])