]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script: allow use of run_tox.sh with default tox envlist
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 19 Mar 2024 17:28:53 +0000 (13:28 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 20 Mar 2024 15:06:45 +0000 (11:06 -0400)
Add a "magic" --tox-envs value to force the run_tox.sh script to
defer to the tox.ini file's envlist rather than specifying a
custom env list. Pass `--tox-envs __tox_defaults__` to the script
to use whatever the tox.ini defaults are.

Adding a magic value like this avoids the need to make breaking changes
(or any changes) to the current cmake "code" used to invoke the
tox tests from make check. It's a little hacky but the funny looking
value should make it clear that it's special. In particular it avoids
adding new conditionals to the cmake files.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/script/run_tox.sh

index 9d45d8b9246ce41241aae48e047123fb7a5b8a5f..f2f71a60f292c64a4fa6de2a1a22f751a4f868fe 100755 (executable)
@@ -125,7 +125,11 @@ function main() {
     export CEPH_BUILD_DIR=$build_dir
     # use the wheelhouse prepared by install-deps.sh
     export PIP_FIND_LINKS="$tox_path/wheelhouse"
-    tox -c $tox_path/tox.ini -e "$tox_envs" "$@"
+    tox_cmd=(tox -c $tox_path/tox.ini)
+    if [ "$tox_envs" != "__tox_defaults__" ]; then
+        tox_cmd+=("-e" "$tox_envs")
+    fi
+    "${tox_cmd[@]}" "$@"
 }
 
 main "$@"