Skip to content

Commit

Permalink
fixed indent in create test and catch sytnax in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
terrance.mcguinness committed Jul 10, 2024
1 parent aff12e4 commit 54c931c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
16 changes: 8 additions & 8 deletions ci/scripts/tests/test_create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 54c931c

Please sign in to comment.