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