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