]> sourceware.org Git - libabigail.git/commitdiff
Fix silent failure of tests/runtestfedabipkgdiff.py
authorDodji Seketeli <dodji@redhat.com>
Mon, 23 Jan 2017 23:37:22 +0000 (00:37 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 15 Feb 2017 14:48:53 +0000 (15:48 +0100)
It turns out the test <builddir>/tests/runtestfedabipkgdiff.py is
failing, but "make check TESTS=runtestfedabipkgdiff.py" is not.

In other words, runtestfedabipkgdiff.py is failing silently; we don't
see it when doing "make check".

The reason why runtestfedabipkgdiff.py is failing is that
mockfedabipkgdiff is trying to patch the global variable
DEFAULT_KOJI_TOPDIR from the fedabipkgdiff file; and that global
variable is not present in that file.  The right global variable that
we want is DEFAULT_KOJI_TOPURL.

This patch fixes that issue.

The reason why the failing above is silent is because the the main
function wasn't returning 0 upon success and 1 otherwise.

This patch fixes that issue as well.

So with this patch, <builddir>/tests/runtestfedabipkgdiff does not
fail anymore and when it does, the "make check TESTS=runtestfedabipkgdiff.py"
fails as well.

* tests/mockfedabipkgdiff.in (run_fedabipkgdiff): Patch
fedabipkgdiff.DEFAULT_KOJI_TOPURL instead of
fedabipkgdiff.DEFAULT_KOJI_TOPDIR.
* tests/runtestfedabipkgdiff.py.in (main): Properly return 0 upon
success, 1 otherwise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
tests/mockfedabipkgdiff.in
tests/runtestfedabipkgdiff.py.in

index 2141983736878cfd42a311462834c0ffa05bab35..68d26faf0f93d93fc50e151db1a73949b7575556 100644 (file)
@@ -359,7 +359,7 @@ class MockClientSession(object):
 
 
 @patch('koji.ClientSession', new=MockClientSession)
-@patch('fedabipkgdiff.DEFAULT_KOJI_TOPDIR', new=TEST_TOPDIR)
+@patch('fedabipkgdiff.DEFAULT_KOJI_TOPURL', new=TEST_TOPDIR)
 @patch('fedabipkgdiff.DEFAULT_ABIPKGDIFF', new=ABIPKGDIFF)
 @patch('fedabipkgdiff.get_download_dir', side_effect=mock_get_download_dir)
 def run_fedabipkgdiff(get_download_dir):
index 55761c01b7eefbe6344245534f6c51271852bc09..9777415fabd85ce919e4a17184fcc6e31f974069 100755 (executable)
@@ -150,14 +150,13 @@ def main():
     This creates the output directory and launches the tests for the
     fedabipkgdiff program.
 
+    :return: 0 upon success, 1 otherwise.
     """
 
     ensure_output_dir_created()
     result = 0
     result = run_fedabipkgdiff_tests()
-    if not result:
-        return result
-
+    return not result
 
 if __name__ == '__main__':
     exit_code = main()
This page took 0.036523 seconds and 5 git commands to generate.