ATLAS Offline Software
Loading...
Searching...
No Matches
python.Test.WorkflowTest Class Reference
Inheritance diagram for python.Test.WorkflowTest:
Collaboration diagram for python.Test.WorkflowTest:

Public Member Functions

None __init__ (self, str ID, WorkflowRun run, WorkflowType type, list[str] steps, TestSetup setup)
None run_reference (self)
None run_validation (self)
bool run_checks (self, list[WorkflowCheck] performance_checks)

Public Attributes

 ID = ID
 tag = ID
 steps = steps
 command
list output_checks = []
list digest_checks = []
bool skip_performance_checks = False
 diff_tolerances = None
 run = run
 type = type
 setup = setup
 logger = setup.logger
Path validation_path = self.setup.validation_run_path / f"run_{self.ID}"
Path reference_path = self.setup.reference_run_path / f"run_{self.ID}"

Detailed Description

Workflow test base class.

Definition at line 131 of file Tools/WorkflowTestRunner/python/Test.py.

Constructor & Destructor Documentation

◆ __init__()

None python.Test.WorkflowTest.__init__ ( self,
str ID,
WorkflowRun run,
WorkflowType type,
list[str] steps,
TestSetup setup )

Definition at line 134 of file Tools/WorkflowTestRunner/python/Test.py.

134 def __init__(self, ID: str, run: WorkflowRun, type: WorkflowType, steps: list[str], setup: TestSetup) -> None:
135 if not hasattr(self, "ID"):
136 self.ID = ID
137
138 if not hasattr(self, "tag"):
139 self.tag = ID
140
141 if not hasattr(self, "steps"):
142 self.steps = steps
143
144 if not self.command:
145 raise NotImplementedError("Command needs to be defined")
146
147 if not hasattr(self, "output_checks"):
148 self.output_checks = []
149
150 if not hasattr(self, "digest_checks"):
151 self.digest_checks = []
152
153 if not hasattr(self, "skip_performance_checks"):
154 self.skip_performance_checks = False
155
156 if not hasattr(self, "diff_tolerances"):
157 self.diff_tolerances = None
158
159 self.run = run
160 self.type = type
161 self.setup = setup
162 self.logger = setup.logger
163 self.validation_path: Path = self.setup.validation_run_path / f"run_{self.ID}"
164 self.reference_path: Path = self.setup.reference_run_path / f"run_{self.ID}"
165

Member Function Documentation

◆ run_checks()

bool python.Test.WorkflowTest.run_checks ( self,
list[WorkflowCheck] performance_checks )

Definition at line 203 of file Tools/WorkflowTestRunner/python/Test.py.

203 def run_checks(self, performance_checks: list[WorkflowCheck]) -> bool:
204 self.logger.info("-----------------------------------------------------")
205 self.logger.info(f"----------- Post-processing of {self.ID} Test -----------")
206 result = True
207
208 # digest checks
209 for check in self.digest_checks:
210 result = check.run(self) and result
211
212 # output checks
213 if not self.setup.disable_output_checks:
214 for check in self.output_checks:
215 result = check.run(self) and result
216
217 if self.setup.validation_only or self.skip_performance_checks:
218 return result # Performance checks against static references not possible
219
220 # performance checks
221 for check in performance_checks:
222 result = check.run(self) and result
223
224 return result

◆ run_reference()

None python.Test.WorkflowTest.run_reference ( self)

Definition at line 166 of file Tools/WorkflowTestRunner/python/Test.py.

166 def run_reference(self) -> None:
167 self.logger.info(f"Running reference in rel {self.setup.release_reference}")
168 self.logger.info(f"\"{self.command}\"")
169
170 self.reference_path.mkdir(parents=True, exist_ok=True)
171
172 cmd = (f"cd {self.reference_path};"
173 f"source $AtlasSetup/scripts/asetup.sh {self.setup.release_reference} >& /dev/null;")
174 cmd += f"TRF_NOECHO=1 {self.command} > {self.ID}.log 2>&1"
175
176 subprocess.call(cmd, shell=True)
177
178 self.logger.info(f"Finished clean in rel {self.setup.release_reference}")
179 self.logger.info(f"\"{self.command}\"")
180

◆ run_validation()

None python.Test.WorkflowTest.run_validation ( self)

Definition at line 181 of file Tools/WorkflowTestRunner/python/Test.py.

181 def run_validation(self) -> None:
182 self.logger.info(f"Running validation in rel {self.setup.release_validation}")
183 self.logger.info(f"\"{self.command}\"")
184
185 self.validation_path.mkdir(parents=True, exist_ok=True)
186
187 cmd = f"cd {self.validation_path};"
188 if self.setup.disable_release_setup or not self.setup.release_validation:
189 pass
190 elif "WorkDir_DIR" in environ:
191 cmake_build_dir = environ["WorkDir_DIR"]
192 cmd += (f"source $AtlasSetup/scripts/asetup.sh {self.setup.release_validation} >& /dev/null;"
193 f"source {cmake_build_dir}/setup.sh;")
194 else:
195 cmd += f"source $AtlasSetup/scripts/asetup.sh {self.setup.release_validation} >& /dev/null;"
196 cmd += f"TRF_NOECHO=1 {self.command} > {self.ID}.log 2>&1"
197
198 subprocess.call(cmd, shell=True)
199
200 self.logger.info(f"Finished validation in rel {self.setup.release_validation}")
201 self.logger.info(f"\"{self.command}\"")
202

Member Data Documentation

◆ command

python.Test.WorkflowTest.command

Definition at line 144 of file Tools/WorkflowTestRunner/python/Test.py.

◆ diff_tolerances

python.Test.WorkflowTest.diff_tolerances = None

Definition at line 157 of file Tools/WorkflowTestRunner/python/Test.py.

◆ digest_checks

list python.Test.WorkflowTest.digest_checks = []

Definition at line 151 of file Tools/WorkflowTestRunner/python/Test.py.

◆ ID

python.Test.WorkflowTest.ID = ID

Definition at line 136 of file Tools/WorkflowTestRunner/python/Test.py.

◆ logger

python.Test.WorkflowTest.logger = setup.logger

Definition at line 162 of file Tools/WorkflowTestRunner/python/Test.py.

◆ output_checks

list python.Test.WorkflowTest.output_checks = []

Definition at line 148 of file Tools/WorkflowTestRunner/python/Test.py.

◆ reference_path

Path python.Test.WorkflowTest.reference_path = self.setup.reference_run_path / f"run_{self.ID}"

Definition at line 164 of file Tools/WorkflowTestRunner/python/Test.py.

◆ run

python.Test.WorkflowTest.run = run

Definition at line 159 of file Tools/WorkflowTestRunner/python/Test.py.

◆ setup

python.Test.WorkflowTest.setup = setup

Definition at line 161 of file Tools/WorkflowTestRunner/python/Test.py.

◆ skip_performance_checks

bool python.Test.WorkflowTest.skip_performance_checks = False

Definition at line 154 of file Tools/WorkflowTestRunner/python/Test.py.

◆ steps

python.Test.WorkflowTest.steps = steps

Definition at line 142 of file Tools/WorkflowTestRunner/python/Test.py.

◆ tag

python.Test.WorkflowTest.tag = ID

Definition at line 139 of file Tools/WorkflowTestRunner/python/Test.py.

◆ type

python.Test.WorkflowTest.type = type

Definition at line 160 of file Tools/WorkflowTestRunner/python/Test.py.

◆ validation_path

Path python.Test.WorkflowTest.validation_path = self.setup.validation_run_path / f"run_{self.ID}"

Definition at line 163 of file Tools/WorkflowTestRunner/python/Test.py.


The documentation for this class was generated from the following file: