]> arthur.barton.de Git - bup.git/commitdiff
Pull some tests forward to improve parallel runtimes
authorRob Browning <rlb@defaultvalue.org>
Fri, 13 Nov 2020 18:25:01 +0000 (12:25 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 26 Nov 2020 21:53:09 +0000 (15:53 -0600)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
conftest.py

index 394ed3456bc5d4c7784b551f00cf19b6511c21a6..14cf647bf6ed6bacd6b56c6ac274d6188019d45d 100644 (file)
@@ -21,6 +21,15 @@ _bup_src_top = realpath(dirname(fsencode(__file__)))
 # https://groups.google.com/forum/#!topic/bup-list/9ke-Mbp10Q0
 os.chdir(realpath(os.getcwd()))
 
+def bup_test_sort_order(item):
+    # Pull some slower tests forward to speed parallel runs
+    if item.fspath.basename in ('test_get.py', 'test-index.sh'):
+        return (0, str(item.fspath))
+    return (1, str(item.fspath))
+
+def pytest_collection_modifyitems(session, config, items):
+    items.sort(key=bup_test_sort_order)
+
 @pytest.fixture(autouse=True)
 def no_lingering_errors():
     def fail_if_errors():