[reprotest] 01/01: Make some variations more reliable, so tests don't fail

Ximin Luo infinity0 at debian.org
Fri Sep 23 20:04:23 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 4797f65ff2affa860bd6a03a7c14f1bd774f4b4b
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri Sep 23 22:02:57 2016 +0200

    Make some variations more reliable, so tests don't fail
---
 debian/changelog      |  6 ++++++
 reprotest/__init__.py | 17 +++++++++++------
 tests/tests.py        |  2 +-
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2112780..0672bac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+reprotest (0.3.1) UNRELEASED; urgency=medium
+
+  * Make some variations more reliable, so tests don't fail.
+
+ -- Ximin Luo <infinity0 at debian.org>  Fri, 23 Sep 2016 22:02:35 +0200
+
 reprotest (0.3) unstable; urgency=medium
 
   [ Daniel Kahn Gillmor ]
diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 7dbc65b..1d79cf5 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -141,6 +141,8 @@ class Script(collections.namedtuple('_Script', 'build_command setup cleanup')):
 # time zone, locales, disorderfs, host name, user/group, shell, CPU
 # number, architecture for uname (using linux64), umask, HOME, see
 # also: https://tests.reproducible-builds.org/index_variations.html
+# TODO: the below ideally should *read the current value*, and pick
+# something that's different for the experiment.
 
 # TODO: relies on a pbuilder-specific command to parallelize
 # @_contextlib.contextmanager
@@ -225,11 +227,12 @@ def kernel(script, env, tree, testbed):
 @_contextlib.contextmanager
 def locales(script, env, tree, testbed):
     # env1['LANG'] = 'C'
-    new_env = add(add(env.experiment, 'LANG', 'fr_CH.UTF-8'),
-                  'LC_ALL', 'fr_CH.UTF-8')
+    new_control = add(env.control, 'LC_ALL', 'C')
+    new_experiment = add(add(env.experiment, 'LANG', 'fr_CH.UTF-8'),
+                         'LC_ALL', 'fr_CH.UTF-8')
     # env1['LANGUAGE'] = 'en_US:en'
     # env2['LANGUAGE'] = 'fr_CH:fr'
-    yield script, Pair(env.control, new_env), tree
+    yield script, Pair(new_control, new_experiment), tree
 
 # TODO: Linux-specific.  unshare --uts requires superuser privileges.
 # How is this related to host/domainname?
@@ -264,9 +267,11 @@ def umask(script, env, tree, testbed):
     # umask = _shell_ast.SimpleCommand('', 'umask', _shell_ast.CmdSuffix(['0002']))
     # new_script = (_shell_ast.List([_shell_ast.Term(umask, ';')])
     #               + script.experiment)
-    umask = _shell_ast.SimpleCommand.make('umask', '0002')
-    new_script = script.experiment.append_setup(umask)
-    yield Pair(script.control, new_script), env, tree
+    new_control = script.control.append_setup(
+        _shell_ast.SimpleCommand.make('umask', '0022'))
+    new_experiment = script.experiment.append_setup(
+        _shell_ast.SimpleCommand.make('umask', '0002'))
+    yield Pair(new_control, new_experiment), env, tree
 
 # TODO: This requires superuser privileges.
 @_contextlib.contextmanager
diff --git a/tests/tests.py b/tests/tests.py
index 3f775b4..50f6bc4 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -55,7 +55,7 @@ def test_self_build(virtual_server):
     # figure out which version of setuptools made things reproduce and add a
     # versioned dependency on that one
     assert(1 == subprocess.call(REPROTEST + ['python3 setup.py bdist', 'dist/*.tar.gz'] + 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 sdist; sleep 2', '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

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