Skip to content

WIP: Save install queue in separate dir for each unit test

Phaedrus Leeds requested to merge skip-saving-install-queue into master

Currently some unit tests fail with a message like: Bail out! Gs-FATAL-WARNING: failed to create an app for */*/*/*/chiron.desktop/*

This is because the tests are being run in parallel, and in gs_plugin_loader_setup() we load the install queue from the disk, but the queue is also being written to by other tests so it may have apps in it which can't be understood by the plugin being tested (chiron.desktop is only used by the dummy plugin).

So, read and write the install queue from a temporary directory that is unique to each self test, using an env var set only by those tests. One might wonder if we could instead use G_TEST_OPTION_ISOLATE_DIRS, but that only takes effect during g_test_run() and we call gs_plugin_loader_setup() before that. Another option would be a gs_plugin_loader_override_install_dir() function but using an env var is more consistent with how we do similar overrides, e.g. GS_SELF_TEST_CACHEDIR.

Edited by Phaedrus Leeds

Merge request reports