[Reproducible-commits] [reprotest] 01/01: Parametrize the existing tests in prepartion for adding chroot testing

Ceridwen ceridwen-guest at moszumanska.debian.org
Sun Jun 26 03:42:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

ceridwen-guest pushed a commit to branch virtualization
in repository reprotest.

commit d03b3723a33ad3e651bfe634205a796076970e98
Author: Ceridwen <ceridwenv at gmail.com>
Date:   Sat Jun 25 18:08:39 2016 -0400

    Parametrize the existing tests in prepartion for adding chroot testing
---
 tests/tests.py | 33 ++++++++++++++++++++-------------
 tox.ini        |  2 +-
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/tests/tests.py b/tests/tests.py
index dde865c..1e8d795 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -3,25 +3,32 @@
 
 import subprocess
 
+import pytest
+
 import reprotest
 
-def check_return_code(command, code):
+def check_return_code(command, virtual_server, code):
     try:
-        reprotest.check(command, 'artifact', ['null'], 'tests/')
+        reprotest.check(command, 'artifact', virtual_server, 'tests/')
     except SystemExit as system_exit:
         assert(system_exit.args[0] == code)
 
-def test_check():
-    check_return_code(['python', 'mock_build.py'], 0)
-    # check_return_code(['python', 'mock_failure.py'], 2)
-    check_return_code(['python', 'mock_build.py', 'irreproducible'], 1)
-    check_return_code(['python', 'mock_build.py', 'fileordering'], 1)
-    check_return_code(['python', 'mock_build.py', 'home'], 1)
-    check_return_code(['python', 'mock_build.py', 'kernel'], 1)
-    check_return_code(['python', 'mock_build.py', 'locales'], 1)
-    check_return_code(['python', 'mock_build.py', 'path'], 1)
-    check_return_code(['python', 'mock_build.py', 'timezone'], 1)
-    # check_return_code(['python', 'mock_build.py', 'umask'], 1)
+ at pytest.fixture(scope='module', params=['null']) # , 'chroot'
+def virtual_server(request):
+    if request.param == 'null':
+        return [request.param]
+    else:
+        return request.param
+
+def test_simple_builds(virtual_server):
+    check_return_code(['python', 'mock_build.py'], virtual_server, 0)
+    # check_return_code(['python', 'mock_failure.py'], virtual_server, 2)
+    check_return_code(['python', 'mock_build.py', 'irreproducible'],
+                      virtual_server, 1)
+
+ at pytest.mark.parametrize('variation', ['fileordering', 'home', 'kernel', 'locales', 'path', 'timezone']) #, 'umask'
+def test_variations(virtual_server, variation):
+    check_return_code(['python', 'mock_build.py', variation], virtual_server, 1)
 
 def test_self_build():
     assert(subprocess.call(['reprotest', 'python setup.py bdist', 'dist/reprotest-0.1.linux-x86_64.tar.gz', 'null']) == 1)
diff --git a/tox.ini b/tox.ini
index b438dec..6ac1e9e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -23,4 +23,4 @@ deps =
 #  pytest-cov
   pytest
 # commands = py.test --cov-report html --cov=reprotest tests/tests.py
-commands = coverage run --omit .tox/* --parallel -m py.test tests/tests.py
+commands = coverage run --omit .tox/* --parallel -m py.test {posargs} tests/tests.py

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