[reprotest] 01/01: Fix some things
Ximin Luo
infinity0 at debian.org
Fri Sep 23 14:21:48 UTC 2016
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository reprotest.
commit d667a21c10606d6e19b265409a39aada7f42ff7c
Author: Ximin Luo <infinity0 at debian.org>
Date: Fri Sep 23 16:21:28 2016 +0200
Fix some things
- append to PATH, don't edit it
- use more robust way of calling reprotest that works even when not installed
- add diffoscope to build-deps
---
debian/control | 1 +
reprotest/__init__.py | 2 +-
tests/tests.py | 12 +++++++-----
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/debian/control b/debian/control
index f69f746..8e922d7 100644
--- a/debian/control
+++ b/debian/control
@@ -10,6 +10,7 @@ Build-Depends: debhelper (>= 9),
python3-setuptools,
# tests.py uses debuild from devscripts
devscripts <!nocheck>,
+ diffoscope <!nocheck>,
# test this variation as well
disorderfs <!nocheck>,
python3-coverage <!nocheck>,
diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index a712f44..602a2b9 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -240,7 +240,7 @@ def locales(script, env, tree, testbed):
@_contextlib.contextmanager
def path(script, env, tree, testbed):
new_env = add(env.experiment, 'PATH', env.control['PATH'] +
- '/i_capture_the_path')
+ ':/i_capture_the_path')
yield script, Pair(env.control, new_env), tree
# This doesn't require superuser privileges, but the chsh command
diff --git a/tests/tests.py b/tests/tests.py
index 4104beb..5d81c5f 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -3,11 +3,13 @@
import os
import subprocess
+import sys
import pytest
-
import reprotest
+REPROTEST = [sys.executable, "-m", "reprotest"]
+
def check_return_code(command, virtual_server, code):
try:
retcode = reprotest.check(command, 'artifact', virtual_server, 'tests')
@@ -39,11 +41,11 @@ def test_variations(virtual_server, variation):
check_return_code('python3 mock_build.py ' + variation, virtual_server, 1)
def test_self_build(virtual_server):
- assert(1 == subprocess.call(['reprotest', 'python3 setup.py bdist', 'dist/*.tar.gz'] + virtual_server))
+ assert(1 == subprocess.call(REPROTEST + ['python3 setup.py bdist', 'dist/*.tar.gz'] + virtual_server))
# at time of writing (2016-09-23) these are not expected to reproduce;
# strip-nondeterminism normalises them for Debian
- assert(1 == subprocess.call(['reprotest', 'python3 setup.py sdist 2>/dev/null', 'dist/*.tar.gz'] + virtual_server))
- assert(1 == subprocess.call(['reprotest', 'python3 setup.py bdist_wheel', 'dist/*.whl'] + virtual_server))
+ assert(1 == subprocess.call(REPROTEST + ['python3 setup.py sdist 2>/dev/null', 'dist/*.tar.gz'] + virtual_server))
+ assert(1 == subprocess.call(REPROTEST + ['python3 setup.py bdist_wheel', 'dist/*.whl'] + virtual_server))
# TODO: don't call it if we don't have debian/, e.g. for other distros
def test_debian_build(virtual_server):
@@ -52,6 +54,6 @@ def test_debian_build(virtual_server):
# gets written twice and the second one is the "real" one, but since it
# should all be reproducible, this should be OK.
assert(0 == subprocess.call(
- ['reprotest', 'debuild -b -uc -us', '../*.deb'] + virtual_server,
+ REPROTEST + ['debuild -b -uc -us', '../*.deb'] + virtual_server,
# "nocheck" to stop tests recursing into themselves
env=dict(list(os.environ.items()) + [("DEB_BUILD_OPTIONS", "nocheck")])))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git
More information about the Reproducible-commits
mailing list