From d576fde2d7274dea662d61fad596ef0f424da5eb Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 30 Jun 2021 11:47:00 +0300 Subject: [PATCH] tests: set PIPEWIRE_RUNTIME_DIR and stop using XDG_RUNTIME_DIR Using XDG_RUNTIME_DIR is problematic in test-reserve-device because GTestDBus also exports XDG_RUNTIME_DIR and then unsets it, which makes pipewire end up using $HOME for its socket. Using PIPEWIRE_RUNTIME_DIR is safer, as this variable is only used by pipewire. Also use the build directory as a runtime dir (it always exists and nothing is going to interfere with it) and unset XDG_RUNTIME_DIR from the CI scripts, since nothing else is using it. Closes #39 --- .gitlab-ci.yml | 1 - tests/meson.build | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8def90ee..02fb5012 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -116,7 +116,6 @@ include: - ninja -C "$PW_BUILD_DIR" install # misc environment only for wireplumber - export WP_BUILD_DIR="$PWD/build-wireplumber-$BUILD_ID" - - export XDG_RUNTIME_DIR="$(mktemp -p $PWD -d xdg-runtime-XXXXXX)" - export PKG_CONFIG_PATH="$(dirname $(find "$PREFIX" -name 'libpipewire-*.pc')):$PKG_CONFIG_PATH" script: # Build wireplumber diff --git a/tests/meson.build b/tests/meson.build index 448c7631..7937fb8b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -30,6 +30,9 @@ endif # The common test environment common_test_env = environment({ + 'HOME': '/invalid', + 'XDG_RUNTIME_DIR': '/invalid', + 'PIPEWIRE_RUNTIME_DIR': meson.current_build_dir(), 'XDG_CONFIG_HOME': meson.current_build_dir() / '.config', 'WIREPLUMBER_CONFIG_DIR': '/invalid', 'WIREPLUMBER_DATA_DIR': '/invalid',