Don't load vendor extensions when running unit tests

a) they can screw up our expected output/behavior
b) they can blow up your system

In my case, the unit tests were calling Pantheon's fish integration
script which would then proceed to blow up dbus with messages about each
individual test completing.
This commit is contained in:
Mahmoud Al-Qudsi 2020-07-12 19:12:32 -05:00
parent 6d45dd837f
commit 9f8e4ab524

View file

@ -77,19 +77,25 @@ else
set xdg_data_dirs $__fish_data_dir set xdg_data_dirs $__fish_data_dir
end end
set -l vendor_completionsdirs $xdg_data_dirs/vendor_completions.d set -l vendor_completionsdirs
set -l vendor_functionsdirs $xdg_data_dirs/vendor_functions.d set -l vendor_functionsdirs
set -l vendor_confdirs $xdg_data_dirs/vendor_conf.d set -l vendor_confdirs
# Don't load vendor directories when running unit tests
if not set -q FISH_UNIT_TESTS_RUNNING
set vendor_completionsdirs $xdg_data_dirs/vendor_completions.d
set vendor_functionsdirs $xdg_data_dirs/vendor_functions.d
set vendor_confdirs $xdg_data_dirs/vendor_conf.d
# Ensure that extra directories are always included. # Ensure that extra directories are always included.
if not contains -- $__extra_completionsdir $vendor_completionsdirs if not contains -- $__extra_completionsdir $vendor_completionsdirs
set -a vendor_completionsdirs $__extra_completionsdir set -a vendor_completionsdirs $__extra_completionsdir
end end
if not contains -- $__extra_functionsdir $vendor_functionsdirs if not contains -- $__extra_functionsdir $vendor_functionsdirs
set -a vendor_functionsdirs $__extra_functionsdir set -a vendor_functionsdirs $__extra_functionsdir
end end
if not contains -- $__extra_confdir $vendor_confdirs if not contains -- $__extra_confdir $vendor_confdirs
set -a vendor_confdirs $__extra_confdir set -a vendor_confdirs $__extra_confdir
end
end end
# Set up function and completion paths. Make sure that the fish # Set up function and completion paths. Make sure that the fish