From 345e3d068a7f3eb37bb795a38572ae06213a8341 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 4 Oct 2024 19:13:20 -0700 Subject: [PATCH] testsuite: override NIX_CONF_DIR and NIX_USER_CONF_FILES The test suite can load the global configuration files under certain circumstances, and, though we would really rather it didn't ever do that at all, we should at least break the mechanism. Fixes: https://git.lix.systems/lix-project/lix/issues/474 Change-Id: Ib27cb43dd5dfaa70ac491c395b5ba308fd7bd289 --- tests/unit/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 8b0c66dd8..04fdf62a7 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -12,7 +12,11 @@ # It's only ~200 lines; better to just refactor the tests themselves which we'll want to do anyway. default_test_env = { - 'ASAN_OPTIONS': 'detect_leaks=0:halt_on_error=1:abort_on_error=1:print_summary=1:dump_instruction_bytes=1' + 'ASAN_OPTIONS': 'detect_leaks=0:halt_on_error=1:abort_on_error=1:print_summary=1:dump_instruction_bytes=1', + # Prevents loading global configuration file in /etc/nix/nix.conf in tests 😱 + 'NIX_CONF_DIR': '/var/empty', + # Prevent loading user configuration files in tests + 'NIX_USER_CONF_FILES': '', } libutil_test_support_sources = files(