[reprotest] 01/01: tests: Try again with even more detail

Ximin Luo infinity0 at debian.org
Fri Oct 27 00:51:33 UTC 2017


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

infinity0 pushed a commit to branch master
in repository reprotest.

commit b32470e1e82f72041a51d3f71982c41449644940
Author: Ximin Luo <infinity0 at debian.org>
Date:   Fri Oct 27 02:51:20 2017 +0200

    tests: Try again with even more detail
---
 tests/mock_build.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tests/mock_build.py b/tests/mock_build.py
index a6ccca4..3acc837 100755
--- a/tests/mock_build.py
+++ b/tests/mock_build.py
@@ -6,8 +6,10 @@ import binascii
 import locale
 import os
 import pathlib
+import platform
 import stat
 import subprocess
+import sys
 import tempfile
 import time
 
@@ -19,7 +21,7 @@ if __name__ == '__main__':
     arg_parser.add_argument('captures', nargs='*',
                             help='Reproducibility properties.')
     captures = set(arg_parser.parse_args().captures)
-    output = ['']
+    output = ["mock-build: " + ", ".join(sorted(captures))]
     # This test can theoretically fail by producing the same
     # random bits in both runs, but it is extremely unlikely.
     if 'irreproducible' in captures:
@@ -28,7 +30,7 @@ if __name__ == '__main__':
     # producing the same file order, but this is unlikely, if not
     # as unlikely as in the above test.
     if 'environment' in captures:
-        output.append("\n".join(os.environ.keys()))
+        output.extend("%s=%s" % pair for pair in os.environ.items())
     if 'build_path' in captures:
         output.append(os.getcwd())
     if 'fileordering' in captures:
@@ -39,6 +41,8 @@ if __name__ == '__main__':
             for i in range(20):
                 str((test_file_order/str(i)).touch())
             output.extend(p.name for p in test_file_order.iterdir())
+    if 'domain_host' in captures:
+        output.append(platform.node())
     if 'home' in captures:
         output.append(os.path.expanduser('~'))
     if 'kernel' in captures:
@@ -59,5 +63,7 @@ if __name__ == '__main__':
             output.append(stat.filemode(test_permissions.stat().st_mode))
     else:
         os.umask(0o0022) # otherwise open() will capture the surrounding one in its file metadata
-    with open('artifact', 'w') as artifact:
-        artifact.write(''.join(output))
+    with open('artifact', 'w') as fp:
+        for line in output:
+            print(line, file=fp)
+            print(line, file=sys.stderr)

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