Skip to content

Commit 3148bb4

Browse files
committed
Allow running a subset of tagged unittests for splitting
1 parent 149d259 commit 3148bb4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def collect_working_tests():
7272
for tagfile in glob.glob(glob_pattern):
7373
test = os.path.splitext(os.path.basename(tagfile))[0]
7474
working_tests.append((test, working_selectors(tagfile)))
75-
return working_tests
75+
return sorted(working_tests)
7676

7777

7878
def make_test_function(working_test):
@@ -110,7 +110,17 @@ def make_tests_class():
110110
class TestTaggedUnittests(unittest.TestCase):
111111
pass
112112

113-
working_tests = collect_working_tests()
113+
partial = os.environ.get('TAGGED_UNITTEST_PARTIAL')
114+
if partial:
115+
selected_str, total_str = partial.split('/', 1)
116+
selected = int(selected_str) - 1
117+
total = int(total_str)
118+
else:
119+
selected = 0
120+
total = 1
121+
assert selected < total
122+
123+
working_tests = collect_working_tests()[selected::total]
114124
for idx, working_test in enumerate(working_tests):
115125
fn = make_test_function(working_test)
116126
fn.__name__ = "%s[%d/%d]" % (fn.__name__, idx + 1, len(working_tests))

0 commit comments

Comments
 (0)