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