[reprotest] 02/02: Fix tests some more

Ximin Luo infinity0 at debian.org
Fri Sep 23 17:05:59 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 570084bd8c2705d6cb65544e644ae921b5c946c4
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri Sep 23 18:56:17 2016 +0200

    Fix tests some more
    
    - add PYTHONIOENCODING=utf-8 since locales aren't set in pbuilder sometimes
    - in mock_build.py, gracefully handle when getlocale() returns (None, None)
---
 debian/control      | 5 ++++-
 debian/rules        | 5 +++--
 tests/mock_build.py | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/debian/control b/debian/control
index 8e922d7..f3a99d7 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,10 @@ Build-Depends: debhelper (>= 9),
  disorderfs <!nocheck>,
  python3-coverage <!nocheck>,
  python3-pytest <!nocheck>,
- tox <!nocheck>
+ tox <!nocheck>,
+# these below helps diffoscope produce nicer output in tests
+ python3-tlsh <!nocheck>,
+ unzip <!nocheck>
 Vcs-Git: https://anonscm.debian.org/git/reproducible/reprotest.git
 Vcs-Browser: https://anonscm.debian.org/git/reproducible/reprotest.git
 X-Python3-Version: >= 3.5
diff --git a/debian/rules b/debian/rules
index 3e5aeec..729f6f2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,6 +8,7 @@ export PYBUILD_NAME = reprotest
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-# FIXME: doesn't work on pbuilder atm, tox wants network even with --sitepackages for some reason >:[
-	REPROTEST_TEST_SERVERS=null tox -r --sitepackages -- -s
+# FIXME: The patch from #838663 is also required for this to work on pbuilder
+	TOX_TESTENV_PASSENV=PYTHONIOENCODING PYTHONIOENCODING=utf-8 \
+	REPROTEST_TEST_SERVERS=null PATH=$$PWD/debian:$$PATH tox -r --sitepackages -- -s
 endif
diff --git a/tests/mock_build.py b/tests/mock_build.py
index 5b43a1e..8223fc6 100755
--- a/tests/mock_build.py
+++ b/tests/mock_build.py
@@ -39,7 +39,7 @@ if __name__ == '__main__':
     if 'kernel' in variations:
         output.append(subprocess.check_output(['uname', '-r']))
     if 'locales' in variations:
-        output.extend(l.encode('ascii') for l in locale.getlocale())
+        output.extend(l.encode('ascii') if l else b'(None)' for l in locale.getlocale())
     if 'path' in variations:
         output.extend(p.encode('ascii') for p in os.get_exec_path())
     if 'timezone' in variations:

-- 
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