13import validation_gt
as vgt
25 "caf_script":
"caf_klm_channel_status.py",
26 "database_chain": [globaltag
for globaltag
in reversed(vgt.get_validation_globaltags())],
27 "requested_iov": [0, 0, -1, -1]
29 with open(
"config.json",
"w")
as config_json:
30 json.dump(config, config_json)
35 [f
"{calibration_path}/cdst_e0008_r3121_hadronSkim/", [8, 3121]],
36 [f
"{calibration_path}/cdst_e0010_r5095_hadronSkim/", [10, 5095]]
39 [f
"{calibration_path}/cdst_e0008_r3121_cosmicSkim/", [8, 3121]],
40 [f
"{calibration_path}/cdst_e0010_r5095_cosmicSkim/", [10, 5095]]
44 with open(
"input_files.json",
"w")
as input_files_json:
45 json.dump(input_files, input_files_json)
49 subprocess.check_call([
'b2caf-prompt-run',
'Local',
'config.json',
'input_files.json',
'--heartbeat',
'20'])
50 except subprocess.CalledProcessError
as e:
54 sub_name = basf2.find_file(
'calibration_results/KLMChannelStatus/0/collector_output/raw/0/submit.sh',
'',
True)
56 with open(sub_name)
as sub_file:
57 basf2.B2ERROR(
'Calibration failed, here is the submit.sh of the first collector job.')
58 print(sub_file.read())
60 out_name = basf2.find_file(
'calibration_results/KLMChannelStatus/0/collector_output/raw/0/stdout',
'',
True)
62 with open(out_name)
as out_file:
63 basf2.B2ERROR(
'Calibration failed, here is the stdout of the first collector job.')
64 print(out_file.read())
66 err_name = basf2.find_file(
'calibration_results/KLMChannelStatus/0/collector_output/raw/0/stderr',
'',
True)
68 with open(err_name)
as err_file:
69 basf2.B2ERROR(
'Calibration failed, here is the stderr of the first collector job.')
70 print(err_file.read())
71 basf2.B2FATAL(f
'The test failed because an exception was raised ({e}). '
72 'Please re-run the run-tests stage if this failure happened in the GitLab pipeline.')
def print_belle2_environment()
def require_file(filename, data_type="", py_case=None)
def clean_working_directory()
def skip_test(reason, py_case=None)