13 import validation_gt
as vgt
22 "caf_script":
"caf_klm_channel_status.py",
23 "database_chain": [globaltag
for globaltag
in reversed(vgt.get_validation_globaltags())],
24 "requested_iov": [0, 0, -1, -1]
26 with open(
"config.json",
"w")
as config_json:
27 json.dump(config, config_json)
32 [f
"{calibration_path}/cdst_e0008_r3121_hadronSkim/", [8, 3121]],
33 [f
"{calibration_path}/cdst_e0010_r5095_hadronSkim/", [10, 5095]]
36 [f
"{calibration_path}/cdst_e0008_r3121_cosmicSkim/", [8, 3121]],
37 [f
"{calibration_path}/cdst_e0010_r5095_cosmicSkim/", [10, 5095]]
41 with open(
"input_files.json",
"w")
as input_files_json:
42 json.dump(input_files, input_files_json)
46 subprocess.check_call([
'b2caf-prompt-run',
'Local',
'config.json',
'input_files.json',
'--heartbeat',
'20'])
47 except subprocess.CalledProcessError
as e:
51 sub_name = basf2.find_file(
'calibration_results/KLMChannelStatus/0/collector_output/raw/0/submit.sh',
'',
True)
53 with open(sub_name)
as sub_file:
54 basf2.B2ERROR(
'Calibration failed, here is the submit.sh of the first collector job.')
55 print(sub_file.read())
57 out_name = basf2.find_file(
'calibration_results/KLMChannelStatus/0/collector_output/raw/0/stdout',
'',
True)
59 with open(out_name)
as out_file:
60 basf2.B2ERROR(
'Calibration failed, here is the stdout of the first collector job.')
61 print(out_file.read())
63 err_name = basf2.find_file(
'calibration_results/KLMChannelStatus/0/collector_output/raw/0/stderr',
'',
True)
65 with open(err_name)
as err_file:
66 basf2.B2ERROR(
'Calibration failed, here is the stderr of the first collector job.')
67 print(err_file.read())
69 f
'The test failed because an exception was raised ({e}). Please re-run the build if this failure happened on bamboo.')
def require_file(filename, data_type="", py_case=None)
def clean_working_directory()
def print_belle2_environment()