From c1895bd1d936797e3bda205928ff19019a971e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Fri, 18 Sep 2026 13:44:16 +0200 Subject: [PATCH] [Tests] Give loader matcher tests a writable HOME in CI Under GitHub's docker runner the process uid has no passwd entry, so HOME resolves to '/' and the test-mode qttest data dir cannot be created. SettingsCache's QSettings then drops every write, getPicsPath() comes back empty, and the loader searches a blank path. Point HOME at a QTemporaryDir for the duration of the run. --- tests/loader_local_matching_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/loader_local_matching_test.cpp b/tests/loader_local_matching_test.cpp index 877728014..7ffa7157d 100644 --- a/tests/loader_local_matching_test.cpp +++ b/tests/loader_local_matching_test.cpp @@ -169,6 +169,16 @@ int main(int argc, char **argv) // Redirect SettingsCache reads/writes (app-data location) away from the real user profile. QStandardPaths::setTestModeEnabled(true); + // Some CI containers run as a uid without a passwd entry (e.g. GitHub's docker + // runner), so HOME resolves to "/" and the test-mode qttest data dir cannot be + // created. SettingsCache's QSettings then silently drops every write, reads come + // back empty, and the paths the loader searches are "". Give the test a writable + // HOME for the duration of the run so settings behave like on a normal machine. + QTemporaryDir home; + if (home.isValid()) { + qputenv("HOME", home.path().toLocal8Bit()); + } + QCoreApplication app(argc, argv); QLoggingCategory::setFilterRules("card_picture_loader.*=false\nsettings_cache.*=false");