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

Public Member Functions

None __init__ (self, str ID, WorkflowRun run, WorkflowType type, list[str] steps, TestSetup setup, str extra_args="")
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

General workflow q-test.

Definition at line 27 of file StandardTests.py.

Constructor & Destructor Documentation

◆ __init__()

None python.StandardTests.QTest.__init__ ( self,
str ID,
WorkflowRun run,
WorkflowType type,
list[str] steps,
TestSetup setup,
str extra_args = "" )

Definition at line 30 of file StandardTests.py.

30 def __init__(self, ID: str, run: WorkflowRun, type: WorkflowType, steps: list[str], setup: TestSetup, extra_args: str = "") -> None:
31 if "maxEvents" not in extra_args:
32 if type == WorkflowType.MCPileUpReco or run == WorkflowRun.Run4:
33 extra_args += " --maxEvents 5"
34 else:
35 extra_args += " --maxEvents 20"
36
37 if type == WorkflowType.MCPileUpReco:
38 if "inputHITSFile" not in extra_args:
39 extra_args += f" --inputHITSFile {input_HITS[run]}"
40 if "inputRDO_BKGFile" not in extra_args:
41 extra_args += " --inputRDO_BKGFile ../run_d*/myRDO.pool.root"
42
43 threads = 1
44 threads_argument = '--multithreaded'
45 if setup.custom_threads is not None:
46 threads = setup.custom_threads
47 if threads <= 0:
48 threads_argument = ''
49
50 self.command = \
51 (f"ATHENA_CORE_NUMBER={threads} Reco_tf.py {threads_argument} --AMIConfig {ID}"
52 f" --imf False {extra_args}")
53
54 self.output_checks = []
55 # TODO: disable RDO comparison for now
56 # if type == WorkflowType.MCReco:
57 # self.output_checks.append(FrozenTier0PolicyCheck(setup, "RDO", 10))
58 self.output_checks.append(FrozenTier0PolicyCheck(setup, "AOD", 60))
59 self.output_checks.append(FrozenTier0PolicyCheck(setup, "ESD", 20))
60 self.output_checks.append(MetadataCheck(setup, "AOD"))
61
62 self.digest_checks = []
63 if not setup.disable_output_checks:
64 self.digest_checks.append(AODContentCheck(setup))
65 self.digest_checks.append(AODDigestCheck(setup))
66
67 super().__init__(ID, run, type, steps, setup)
68
69

Member Function Documentation

◆ run_checks()

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

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)
inherited

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)
inherited

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
inherited

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

◆ diff_tolerances

python.Test.WorkflowTest.diff_tolerances = None
inherited

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

◆ digest_checks

list python.Test.WorkflowTest.digest_checks = []
inherited

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

◆ ID

python.Test.WorkflowTest.ID = ID
inherited

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

◆ logger

python.Test.WorkflowTest.logger = setup.logger
inherited

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

◆ output_checks

list python.Test.WorkflowTest.output_checks = []
inherited

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}"
inherited

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

◆ run

python.Test.WorkflowTest.run = run
inherited

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

◆ setup

python.Test.WorkflowTest.setup = setup
inherited

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

◆ skip_performance_checks

bool python.Test.WorkflowTest.skip_performance_checks = False
inherited

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

◆ steps

python.Test.WorkflowTest.steps = steps
inherited

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

◆ tag

python.Test.WorkflowTest.tag = ID
inherited

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

◆ type

python.Test.WorkflowTest.type = type
inherited

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}"
inherited

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


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