From 19edaed81b44acd11a36fc4759e2e0ae69c7f309 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 4 Oct 2024 18:55:52 -0700 Subject: [PATCH 1/2] Remove some outdated `make test` invocation suggestions These should be meson. Change-Id: I03687b8b03f50fb1684e7ffcd487be855052d6c2 --- src/libutil/error.cc | 2 +- tests/functional/lang.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/error.cc b/src/libutil/error.cc index a7cbfbfd0..6d178dfe5 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -132,7 +132,7 @@ static std::string indent(std::string_view indentFirst, std::string_view indentR /** * A development aid for finding missing positions, to improve error messages. Example use: * - * NIX_DEVELOPER_SHOW_UNKNOWN_LOCATIONS=1 _NIX_TEST_ACCEPT=1 make tests/lang.sh.test + * NIX_DEVELOPER_SHOW_UNKNOWN_LOCATIONS=1 _NIX_TEST_ACCEPT=1 just test --suite installcheck -v functional-lang * git diff -U20 tests * */ diff --git a/tests/functional/lang.sh b/tests/functional/lang.sh index 59db10340..ca54fb88d 100755 --- a/tests/functional/lang.sh +++ b/tests/functional/lang.sh @@ -155,7 +155,7 @@ else echo '' echo 'You can rerun this test with:' echo '' - echo ' _NIX_TEST_ACCEPT=1 make tests/functional/lang.sh.test' + echo ' _NIX_TEST_ACCEPT=1 just test --suite installcheck -v functional-lang' echo '' echo 'to regenerate the files containing the expected output,' echo 'and then view the git diff to decide whether a change is' From 345e3d068a7f3eb37bb795a38572ae06213a8341 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 4 Oct 2024 19:13:20 -0700 Subject: [PATCH 2/2] 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(