315 def run(self, test: WorkflowTest) -> bool:
316 self.logger.info("---------------------------------------------------------------------------------------")
317 self.logger.info(f"Running {test.ID} AOD content check")
318
319 file_name = "myAOD.pool.root"
320 output_name = f"{test.ID}_AOD_content.txt"
321
322 validation_file = test.validation_path / file_name
323 validation_output = test.validation_path / output_name
324 validation_command = f"acmd.py chk-file {validation_file} | awk '/---/{{flag=1;next}}/===/{{flag=0}}flag' | awk '{{print $10}}' | LC_ALL=C sort | uniq > {validation_output}"
325
326 output_val, error_val = subprocess.Popen(["/bin/bash", "-c", validation_command], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
327 output_val, error_val = output_val.decode("utf-8"), error_val.decode("utf-8")
328 if error_val:
329 self.logger.
error(f
"Something went wrong with retrieving the content for test {test.ID}:")
330 self.logger.
error(error_val)
331
332
333 if self.setup.validation_only:
334
335 reference_path = test.validation_path
336 reference_output_name = f"{test.ID}_AOD_content.ref"
337 reference_output = reference_path / reference_output_name
338 subprocess.Popen(["/bin/bash", "-c", f"cd {reference_path}; get_files -remove -data {reference_output_name}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
339 if not reference_output.exists():
340 self.logger.info(f"No reference file '{reference_output_name}' to compare the content with.")
341 return True
342 else:
343 reference_path = test.reference_path
344 reference_output = reference_path / output_name
345 reference_file = reference_path / file_name
346
347 reference_command = f"acmd.py chk-file {reference_file} | awk '/---/{{flag=1;next}}/===/{{flag=0}}flag' | awk '{{print $10}}' | LC_ALL=C sort | uniq > {reference_output}"
348 subprocess.Popen(["/bin/bash", "-c", reference_command], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
349
350
351 extra_diff_args = ""
352 if test.type == WorkflowType.MCReco or test.type == WorkflowType.MCPileUpReco:
353 extra_diff_args = "-I '^HLT' -I '^LVL1' -I '^L1'"
354
355
356 diff_output, diff_error = subprocess.Popen(["/bin/bash", "-c", f"diff {extra_diff_args} {reference_output} {validation_output}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
357 diff_output, diff_error = diff_output.decode("utf-8"), diff_error.decode("utf-8")
358
359 result = False
360 if not diff_output and not diff_error:
361 self.logger.info("Passed!\n")
362 result = True
363 else:
364
365 if self.setup.disable_release_setup:
366 self.logger.
print(f
"ATLAS-CI-ADD-LABEL: {test.run.value}-{test.type.value}-output-changed")
367 self.logger.
print(
"")
368
369 self.logger.
error(f
"Your change modifies the output in test {test.ID}.")
370 self.logger.
error(
"Please make sure this has been discussed in the correct meeting (RIG or Simulation) meeting and approved by the relevant experts.")
371 if self.setup.validation_only:
372 self.logger.
error(f
"The output '{output_name}' (>) differs from the reference '{reference_output_name}' (<):")
373 else:
374 self.logger.
error(f
"The output '{validation_output}' (>) differs from the reference '{reference_output}' (<):")
375 if diff_output:
376 self.logger.
print(
"")
377 self.logger.
print(diff_output)
378 if diff_error:
379 self.logger.
print(diff_error)
380 self.logger.info("-----------------------------------------------------\n")
381
382 return result
383
384
void print(char *figname, TCanvas *c1)
int run(int argc, char *argv[])