Skip to content

Commit

Permalink
Merge pull request #197 from johnpaulalex/testpath
Browse files Browse the repository at this point in the history
Fix incorrect logged path of checkout_externals in test_sys_checkout

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: 3009801

It never mattered since this command line is only for debugging.

User interface changes?: No

Fixes: none

Testing:
test removed: none
unit tests: none
system tests: ran an individual test to confirm the printout is now more correct.
manual testing: none
  • Loading branch information
billsacks authored Mar 3, 2023
2 parents a04f114 + 332b106 commit 927ce3a
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 927ce3a

Please sign in to comment.