Skip to content

Commit c693a1e

Browse files
committed
don't run tests that have no tags by default when retagging
1 parent 1efad6b commit c693a1e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def working_selectors(tagfile):
5757
with open(tagfile) as f:
5858
return [line.strip() for line in f if line]
5959
else:
60-
return []
60+
return None
6161

6262

6363
def working_tests():
@@ -95,10 +95,13 @@ def fun():
9595
re_success = re.compile("^(test\S+)[^\r\n]* \.\.\. ok$", re.MULTILINE)
9696
kwargs = {"stdout": subprocess.PIPE, "stderr": subprocess.PIPE, "text": True, "check": False}
9797

98-
if len(sys.argv) > 1:
99-
glob_pattern = sys.argv[1]
100-
else:
101-
glob_pattern = os.path.join(os.path.dirname(test.__file__), "test_*.py")
98+
glob_pattern = os.path.join(os.path.dirname(test.__file__), "test_*.py")
99+
retag = False
100+
for arg in sys.argv[1:]:
101+
if arg == "--retag":
102+
retag = True
103+
else:
104+
glob_pattern = sys.argv[1]
102105

103106
p = subprocess.run(["/usr/bin/which", "timeout"], **kwargs)
104107
if p.returncode != 0:
@@ -114,6 +117,11 @@ def fun():
114117
tagfile = os.path.join(TAGS_DIR, testfile_stem + ".txt")
115118
test_selectors = working_selectors(tagfile)
116119

120+
if test_selectors is None and not retag:
121+
# there's no tagfile for this, so it's not working at all (or has
122+
# not been tried)
123+
continue
124+
117125
print("[%d/%d] Testing %s" %(idx, len(testfiles), testmod))
118126
cmd += ["unittest", "-v"]
119127
for selector in test_selectors:

0 commit comments

Comments
 (0)