nixpkgs/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch

64 lines
2.7 KiB
Diff
Raw Normal View History

2021-07-11 14:00:00 +02:00
commit ccd4dd92cd37acce1da20966ad9e4e0c7bcf1709
Author: Guillaume Girol <symphorien+git@xlumurb.eu>
Date: Sun Jul 11 12:00:00 2021 +0000
use installed duplicity when running tests
diff --git a/setup.py b/setup.py
index fa474f20..604a242a 100755
--- a/setup.py
+++ b/setup.py
2021-07-11 14:00:00 +02:00
@@ -205,10 +205,6 @@ class TestCommand(test):
except Exception:
pass
2021-07-11 14:00:00 +02:00
- os.environ[u'PATH'] = u"%s:%s" % (
- os.path.abspath(build_scripts_cmd.build_dir),
- os.environ.get(u'PATH'))
-
test.run(self)
2021-07-11 14:00:00 +02:00
diff --git a/testing/functional/__init__.py b/testing/functional/__init__.py
index 4221576d..3cf44945 100644
--- a/testing/functional/__init__.py
+++ b/testing/functional/__init__.py
2021-07-11 14:00:00 +02:00
@@ -111,7 +111,7 @@ class FunctionalTestCase(DuplicityTestCase):
run_coverage = os.environ.get(u'RUN_COVERAGE', None)
if run_coverage is not None:
cmd_list.extend([u"-m", u"coverage", u"run", u"--source=duplicity", u"-p"])
2021-07-11 14:00:00 +02:00
- cmd_list.extend([u"{0}/bin/duplicity".format(_top_dir)])
+ cmd_list.extend([u"duplicity"])
cmd_list.extend(options)
cmd_list.extend([u"-v0"])
cmd_list.extend([u"--no-print-statistics"])
2021-07-11 14:00:00 +02:00
diff --git a/testing/functional/test_log.py b/testing/functional/test_log.py
index 9dfc86a6..b9cb55db 100644
--- a/testing/functional/test_log.py
+++ b/testing/functional/test_log.py
2021-07-11 14:00:00 +02:00
@@ -49,9 +49,9 @@ class LogTest(FunctionalTestCase):
# Run actual duplicity command (will fail, because no arguments passed)
basepython = os.environ.get(u'TOXPYTHON', None)
if basepython is not None:
2021-07-11 14:00:00 +02:00
- os.system(u"{0} {1}/bin/duplicity --log-file={2} >/dev/null 2>&1".format(basepython, _top_dir, self.logfile))
+ os.system(u"{0} duplicity --log-file={1} >/dev/null 2>&1".format(basepython, self.logfile))
else:
2021-07-11 14:00:00 +02:00
- os.system(u"{0}/bin/duplicity --log-file={1} >/dev/null 2>&1".format(_top_dir, self.logfile))
+ os.system(u"duplicity --log-file={0} >/dev/null 2>&1".format(self.logfile))
# The format of the file should be:
# """ERROR 2
2021-07-11 14:00:00 +02:00
diff --git a/testing/functional/test_rdiffdir.py b/testing/functional/test_rdiffdir.py
index 0cbfdb33..47acd029 100644
--- a/testing/functional/test_rdiffdir.py
+++ b/testing/functional/test_rdiffdir.py
2021-07-11 14:00:00 +02:00
@@ -44,7 +44,7 @@ class RdiffdirTest(FunctionalTestCase):
2020-09-06 01:37:32 +02:00
basepython = os.environ.get(u'TOXPYTHON', None)
if basepython is not None:
cmd_list.extend([basepython])
2021-07-11 14:00:00 +02:00
- cmd_list.extend([u"{0}/bin/rdiffdir".format(_top_dir)])
2020-09-06 01:37:32 +02:00
+ cmd_list.extend([u"rdiffdir"])
cmd_list.extend(argstring.split())
cmdline = u" ".join([u'"%s"' % x for x in cmd_list])
self.run_cmd(cmdline)