diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 0771077c3b..0554304b6c 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -215,7 +215,7 @@ pipeline { env.RUNTESTS = "${CUSTOM_WORKSPACE}/RUNTESTS" try { error_output = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${Case}.yaml", returnStdout: true).trim() - } catch { + } catch (Exception error_create) { sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${Case} **FAILED** to create experment on ${Machine}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """) error("Case ${Case} failed to create experment directory") } diff --git a/ci/scripts/tests/test_create_experiment.py b/ci/scripts/tests/test_create_experiment.py index 0babefa54b..03f3a30805 100644 --- a/ci/scripts/tests/test_create_experiment.py +++ b/ci/scripts/tests/test_create_experiment.py @@ -17,13 +17,13 @@ def test_create_experiment(): for case in os.listdir(yaml_dir): if case.endswith('.yaml'): - with open(os.path.join(yaml_dir, case), 'r') as file: - file_contents = file.read() - if 'ICSDIR_ROOT' not in file_contents: - create_experiment = copy.deepcopy(create_experiment_script) - create_experiment.add_default_arg(['-y', f'../../cases/pr/{case}', '--overwrite']) - env['pslot'] = os.path.splitext(case)[0] - create_experiment(env=env) - assert (create_experiment.returncode == 0) + with open(os.path.join(yaml_dir, case), 'r') as file: + file_contents = file.read() + if 'ICSDIR_ROOT' not in file_contents: + create_experiment = copy.deepcopy(create_experiment_script) + create_experiment.add_default_arg(['-y', f'../../cases/pr/{case}', '--overwrite']) + env['pslot'] = os.path.splitext(case)[0] + create_experiment(env=env) + assert (create_experiment.returncode == 0) rmtree(RUNDIR)