Was the q test successful? To check simply count the number of lines containing the string "successful run".
Definition at line 11 of file Checks.py.
◆ reference_file()
Optional[Path] python.Test.WorkflowCheck.reference_file |
( |
|
self, |
|
|
"WorkflowTest" |
test, |
|
|
str |
file_name |
|
) |
| |
|
inherited |
Definition at line 91 of file Tools/WorkflowTestRunner/python/Test.py.
91 def reference_file(self, test:
"WorkflowTest", file_name: str) -> Optional[Path]:
92 reference_path: Path = test.reference_path
93 reference_file = reference_path / file_name
96 if self.setup.validation_only:
98 reference_revision = references_map[f
"{test.ID}"]
99 cvmfs_path = Path(references_CVMFS_path)
100 rel_path = Path(self.setup.release_ID) / test.ID / reference_revision
101 reference_path = cvmfs_path / rel_path
102 reference_file = reference_path / file_name
104 if not reference_path.exists():
105 self.logger.
error(f
"CVMFS reference location {reference_path} does not exist!")
108 if references_override_url
is not None:
111 url = references_override_url
112 if not url.endswith(
"/"): url +=
"/"
113 url +=
str(rel_path / file_name)
114 self.logger.
info(
"Checking for reference override at %s", url)
115 if requests.head(url).ok:
116 reference_file = Path.cwd() / f
"reference_{file_name}"
117 self.logger.
info(
"Downloading reference from %s to %s", url, reference_file)
118 r = requests.get(url, stream=
True)
119 with reference_file.open(
'wb')
as f:
120 for chunk
in r.iter_content(chunk_size=1024):
124 self.logger.
info(
"No reference override found")
126 return reference_file
◆ run()
bool python.Checks.FailedOrPassedCheck.run |
( |
|
self, |
|
|
WorkflowTest |
test |
|
) |
| |
Definition at line 14 of file Checks.py.
14 def run(self, test: WorkflowTest) -> bool:
17 for step
in test.steps:
18 self.logger.
info(
"-----------------------------------------------------")
19 log = test.validation_path / f
"log.{step}"
24 with log.open()
as 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:
32 elif step ==
"DQHistogramMerge" and "Writing file: myHIST.root" in line:
36 self.logger.
info(f
"{step} validation test step WARNINGS")
37 warnings =
list(dict.fromkeys(warnings))
39 self.logger.
info(f
" {w}")
40 self.logger.
info(
"-----------------------------------------------------")
43 self.logger.
info(f
"{step} validation test step ERRORS")
44 errors =
list(dict.fromkeys(errors))
46 self.logger.
info(f
" {e}")
47 self.logger.
info(
"-----------------------------------------------------")
49 if counter
and not errors:
50 self.logger.
info(f
"{step} validation test step successful")
52 if step ==
"DQHistogramMerge":
53 self.logger.
info(f
"Full {step} step log:")
54 with log.open()
as file:
56 self.logger.
print(f
" {line.strip()}")
57 self.logger.
info(
"-----------------------------------------------------")
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:
66 self.logger.
print(f
" {line.strip()}")
67 self.logger.
info(
"-----------------------------------------------------")
69 self.logger.
error(f
"{step} validation test step did not run")
72 self.logger.
error(
"Full transform log:")
73 with (test.validation_path / f
"{test.ID}.log").
open()
as file:
75 self.logger.
print(f
" {line.strip()}")
76 self.logger.
info(
"-----------------------------------------------------")
78 if self.setup.validation_only:
81 log = test.reference_path / f
"log.{step}"
83 with log.open()
as file:
85 if '"successful run"' in line:
87 elif (step ==
"DQHistogramMerge"
88 and "Writing file: myHIST.root" in line):
92 self.logger.
info(f
"{step} reference test step successful")
94 self.logger.
error(f
"{step} reference test step failed")
98 self.logger.
info(f
"All {test.ID} athena steps completed successfully\n")
100 self.logger.
error(f
"One or more {test.ID} Athena steps failed. Please investigate the cause.\n")
◆ logger
python.Test.WorkflowCheck.logger |
|
inherited |
◆ setup
python.Test.WorkflowCheck.setup |
|
inherited |
The documentation for this class was generated from the following file: