Skip to content

Commit

Permalink
Fix incorrect logged path of checkout_externals in test_sys_checkout:…
Browse files Browse the repository at this point in the history
… it was basically the parent of the current directory, which varies throughout the test. (it called abspath with '{0}/../../', which adds arbitrary and not-interpolated subdir '{0}' to the path, then removes it and removes one more level).

This change dates back to 6 years ago: ESMCI/manage_externals@3009801

It never mattered since this command line is only for debugging.
  • Loading branch information
johnpaulalex committed Feb 26, 2023
1 parent 932a749 commit 332b106
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/test_sys_checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,16 @@ def _execute_checkout_in_dir(dirname, args, debug_env=''):
"""
cwd = os.getcwd()

# Construct a command line for reproducibility; this command is not actually
# executed in the test.
checkout_path = os.path.abspath('{0}/../../checkout_externals')
# Construct a command line for reproducibility; this command is not
# actually executed in the test.
os.chdir(dirname)
cmdline = ['--externals', CFG_NAME, ]
cmdline += args
manual_cmd = ('Test cmd:\npushd {cwd}; {env} {checkout} {args}'.format(
cwd=dirname, checkout=checkout_path, env=debug_env, args=' '.join(cmdline)))
manual_cmd = ('Running equivalent of:\n'
'pushd {dirname}; '
'{debug_env} /path/to/checkout_externals {args}'.format(
dirname=dirname, debug_env=debug_env,
args=' '.join(cmdline)))
printlog(manual_cmd)
options = checkout.commandline_arguments(cmdline)
overall_status, tree_status = checkout.main(options)
Expand Down

0 comments on commit 332b106

Please sign in to comment.