diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-03-01 09:46:58 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-03-01 09:46:58 +0100 |
commit | 4887a213aa4d4c2a3dcc4583952258c944f3a080 (patch) | |
tree | 2db703228b9ab16d1bcae56f97fa1c8338aabe53 | |
parent | 0276f2b5119c33ad8ba8ff7863844a9e7f143ad5 (diff) |
Only run some of the tests under fakeroot
fakeroot is a blessing and a curse. Since some tests require root,
fakeroot reduces test skips, but on the other hand it also introduces
race conditions to tests and makes e.g. locking tests sporadically fail.
Thus we split tests into fakeroot and non-fakeroot tests to get a good
compromise.
-rwxr-xr-x | debian/rules | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/debian/rules b/debian/rules index 11c67b4d..cec05fc5 100755 --- a/debian/rules +++ b/debian/rules @@ -21,14 +21,6 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all # line switches export PYBUILD_TEST_PYTEST=1 -# Command line arguments to pytest -# -# We cannot rely on the buildds allowing fuse to be -# used, so we disable the fuse-mount tests. -export PYBUILD_TEST_ARGS=\ - -k 'not fuse_mount and not test_fuse and not test_readonly_mount and not test_migrate_lock_alive' \ - --pyargs borg.testsuite - # To display coverage information, add the following # switches to PYBUILD_TEST_ARGS (Upstream does this) # @@ -55,14 +47,17 @@ execute_before_dh_installdocs-indep: execute_before_dh_installman-arch: $(MAKE) -C docs man -# Run dh_auto_test in a fakeroot environment, this will -# disable some feature tests from upstream that are not -# guaranteed to work on a buildd anyway, like acls. +# We run most of the tests in fakeroot to increase test coverage, but fakeroot +# introduces race conditions on its own. +TESTS_NO_FAKEROOT = benchmark.py cache.py checks.py key.py locking.py patterns.py remote.py repository.py shellpattern.py override_dh_auto_test: export TZ=UTC # tests break in TZ=GMT+12, see https://github.com/borgbackup/borg/issues/5535 +override_dh_auto_test: export LC_ALL=C.UTF-8 override_dh_auto_test: -ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - LC_ALL=C.UTF-8 fakeroot dh_auto_test -endif + # fakeroot introduces race conditions to e.g. locking tests. + dh_auto_test -- --test-args "--pyargs borg.testsuite -k '$(subst $(eval) $(eval), or ,$(TESTS_NO_FAKEROOT))'" + # We cannot rely on the buildds allowing fuse to be + # used, so we disable the fuse-mount tests. + fakeroot dh_auto_test -- --test-args "--pyargs borg.testsuite -k 'not fuse_mount and not test_fuse and not test_readonly_mount and not test_migrate_lock_alive $(foreach t,$(TESTS_NO_FAKEROOT),and not $(t))'" execute_after_dh_install-arch: # Add the private module directory to sys.path in borg executables |