246 def run(self, test: WorkflowTest) -> bool:
247 self.logger.info("---------------------------------------------------------------------------------------")
248 self.logger.info(f"Running {test.ID} metadata check on {self.format}")
249
250 file_name = f"my{self.format}.pool.root"
251 if test.type == WorkflowType.Derivation:
252 file_name = f"{self.format}.myOutput.pool.root"
253
254 reference_file = self.reference_file(test, file_name)
255 if reference_file is None:
256 self.logger.
error(f
"Reference file {file_name} not found")
257 return False
258
259 self.logger.info(f"Reading the reference file from location {reference_file}")
260
261 exclusion_list = " ".join([
262 "file_guid", "file_size",
263 "/TagInfo/AtlasRelease", "FileMetaData/productionRelease",
264 ] + ([
265 "auto_flush",
266 "StreamDAOD_PHYS/eventTypes", "StreamDAOD_PHYSLITE/eventTypes",
267 ] if test.type is WorkflowType.Derivation else []))
268
269 validation_file = test.validation_path / file_name
270 log_file = test.validation_path / f"meta-diff-{test.ID}.{self.format}.log"
271
272 comparison_command = f"meta-diff --ordered -m full -x diff {reference_file} {validation_file} --drop {exclusion_list} --ignoreTrigger > {log_file} 2>&1"
273 output, error = subprocess.Popen(["/bin/bash", "-c", comparison_command], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
274 output, error = output.decode("utf-8"), error.decode("utf-8")
275
276 result = True
277 with log_file.open() as file:
278 for line in file:
279 if line.strip():
280 result = False
281
282 if result:
283 self.logger.info("Passed!\n")
284 else:
285
286 if self.setup.disable_release_setup:
287 self.logger.
print(f
"ATLAS-CI-ADD-LABEL: {test.run.value}-{test.type.value}-output-changed")
288 self.logger.
print(
"")
289
290 self.logger.
error(f
"Your change breaks the frozen tier0 policy in test {test.ID}.")
291 self.logger.
error(
"Please make sure this has been discussed in the correct meeting (RIG or Simulation) meeting and approved by the relevant experts.")
292
293
294 if self.setup.disable_release_setup:
295 comparison_command = f"CopyCIArtifact.sh {validation_file}"
296 output, error = subprocess.Popen(["/bin/bash", "-c", comparison_command], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
297 output, error = output.decode("utf-8"), error.decode("utf-8")
298
299 if error or not output:
300 self.logger.
error(f
"Tried copying '{validation_file}' to the CI artifacts area but it failed.")
301 self.logger.
error(f
" {error.strip()}")
302 else:
303 self.logger.
error(output)
304
305 with log_file.open() as file:
306 for line in file:
307 self.logger.info(f" {line.strip()}")
308 self.logger.info("-----------------------------------------------------\n")
309
310 return result
311
void print(char *figname, TCanvas *c1)
int run(int argc, char *argv[])