Skip to content

Commit

Permalink
testsuite: fix on systems with flux-accounting already installed
Browse files Browse the repository at this point in the history
Problem: When flux-accounting is already installed on a system, the
sharness tests pull in the installed version of flux-accounting Python
modules instead of the test version. This occurs because sharness
prepends the source tree Python path to PYTHONPATH, which is then
subverted by flux-core's `py-runner.py`, which prepends the system
path in front of that before executing Python subcommands like the
accounting service etc.

Use FLUX_PYTHONPATH_PREPEND instead of PYTHONPATH, which is preserved
by the py-runner.py wrapper.
  • Loading branch information
grondo committed Jul 11, 2024
1 parent a6bd897 commit 30c195a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/sharness.d/flux-accounting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ prepend_colon_separated() {
SRC_DIR=${SHARNESS_TEST_SRCDIR}/..

prepend_colon_separated FLUX_EXEC_PATH_PREPEND ${SRC_DIR}/src/cmd
prepend_colon_separated PYTHONPATH ${SRC_DIR}/src/bindings/python
prepend_colon_separated FLUX_PYTHONPATH_PREPEND ${SRC_DIR}/src/bindings/python

export FLUX_EXEC_PATH_PREPEND PYTHONPATH
export FLUX_EXEC_PATH_PREPEND FLUX_PYTHONPATH_PREPEND

# vi: ts=4 sw=4 expandtab

0 comments on commit 30c195a

Please sign in to comment.