Skip to content

Commit da046dd

Browse files
committed
don't run the tagged unittests with the default gate on the CI
1 parent 4b88ff0 commit da046dd

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

ci.jsonnet

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@
212212
local testGate = function(type, platform)
213213
baseGraalGate + {tags:: "python-"+type} + getPlatform(platform) + {name: "python-"+ type +"-"+platform},
214214

215+
local testGateTime = function(type, platform, timelimit)
216+
baseGraalGate + {tags:: "python-"+type} + getPlatform(platform) + {name: "python-"+ type +"-"+platform} + {timelimit: timelimit},
217+
215218
local styleGate = baseGraalGate + eclipseMixin + linuxMixin + {
216219
tags:: "style,fullbuild,python-license",
217220
name: "python-style",
@@ -251,7 +254,7 @@
251254
// cannot run with excluded "GeneratedBy" since that would lead to "command line too long"
252255
// ['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', '--jacoco-exclude-annotation', '@GeneratedBy', '--strict-compliance', "--dynamicimports", super.dynamicImports, "--primary", 'gate', '-B=--force-deprecation-as-warning-for-dependencies', '--strict-mode', '--tags', "python-junit", '--jacocout', 'html'],
253256
// ['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', '--jacoco-exclude-annotation', '@GeneratedBy', 'sonarqube-upload', "-Dsonar.host.url=$SONAR_HOST_URL", "-Dsonar.projectKey=com.oracle.graalvm.python", "-Dsonar.projectName=GraalVM - Python", '--exclude-generated'],
254-
['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', '--strict-compliance', "--dynamicimports", super.dynamicImports, "--primary", 'gate', '-B=--force-deprecation-as-warning-for-dependencies', '--strict-mode', '--tags', "python-unittest,python-junit", '--jacocout', 'html'],
257+
['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', '--strict-compliance', "--dynamicimports", super.dynamicImports, "--primary", 'gate', '-B=--force-deprecation-as-warning-for-dependencies', '--strict-mode', '--tags', "python-unittest,python-tagged-unittest,python-junit", '--jacocout', 'html'],
255258
['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', 'sonarqube-upload', "-Dsonar.host.url=$SONAR_HOST_URL", "-Dsonar.projectKey=com.oracle.graalvm.python", "-Dsonar.projectName=GraalVM - Python", '--exclude-generated'],
256259
],
257260
name: "python-coverage"
@@ -265,6 +268,8 @@
265268
// unittests
266269
testGate(type="unittest", platform="linux"),
267270
testGate(type="unittest", platform="darwin"),
271+
testGateTime(type="tagged-unittest", platform="linux", timelimit=TIME_LIMIT["2h"]),
272+
testGateTime(type="tagged-unittest", platform="darwin", timelimit=TIME_LIMIT["2h"]),
268273
testGate(type="svm-unittest", platform="linux"),
269274
testGate(type="svm-unittest", platform="darwin"),
270275

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@
4444
import test
4545

4646

47-
TAGS_DIR = os.path.join(os.path.dirname(__file__), "unittest_tags")
47+
if os.environ.get("ENABLE_CPYTHON_TAGGED_UNITTESTS") == "true" or os.environ.get("CI") is None:
48+
# On the CI, I'd like to explicitly enable these, so we can run them in a
49+
# separate job easily. But it's not important for local execution
50+
TAGS_DIR = os.path.join(os.path.dirname(__file__), "unittest_tags")
51+
else:
52+
TAGS_DIR = "null"
4853

4954

5055
def working_selectors(tagfile):

mx.graalpython/mx_graalpython.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ def python3_unittests(args):
184184
mx.run(["python3", "graalpython/com.oracle.graal.python.test/src/python_unittests.py", "-v"] + args)
185185

186186

187+
def retag_unittests(args):
188+
"""run the cPython stdlib unittests"""
189+
os.environ["ENABLE_CPYTHON_TAGGED_UNITTESTS"] = "true"
190+
try:
191+
python(["graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py"] + args)
192+
finally:
193+
del os.environ["ENABLE_CPYTHON_TAGGED_UNITTESTS"]
194+
195+
187196
# mx gate --tags pythonbenchmarktest
188197
# mx gate --tags pythontest
189198
# mx gate --tags fulltest
@@ -193,6 +202,7 @@ def python3_unittests(args):
193202
class GraalPythonTags(object):
194203
junit = 'python-junit'
195204
unittest = 'python-unittest'
205+
tagged = 'python-tagged-unittest'
196206
cpyext = 'python-cpyext'
197207
cpyext_managed = 'python-cpyext-managed'
198208
cpyext_sandboxed = 'python-cpyext-sandboxed'
@@ -328,6 +338,14 @@ def graalpython_gate_runner(args, tasks):
328338
if task:
329339
gate_unittests()
330340

341+
with Task('GraalPython Python tests', tasks, tags=[GraalPythonTags.tagged-unittest]) as task:
342+
if task:
343+
os.environ["ENABLE_CPYTHON_TAGGED_UNITTESTS"] = "true"
344+
try:
345+
gate_unittests(subdir="test_tagged_unittests.py")
346+
finally:
347+
del os.environ["ENABLE_CPYTHON_TAGGED_UNITTESTS"]
348+
331349
with Task('GraalPython C extension tests', tasks, tags=[GraalPythonTags.cpyext]) as task:
332350
if task:
333351
# we deliberately added this to test the combination of Sulong and 'mx_unittest'
@@ -909,6 +927,7 @@ def python_coverage(args):
909927
'python-svm': [python_svm, ''],
910928
'python-build-svm': [python_build_svm, ''],
911929
'python-unittests': [python3_unittests, ''],
930+
'python-retag-unittests': [retag_unittests, ''],
912931
'nativebuild': [nativebuild, ''],
913932
'nativeclean': [nativeclean, ''],
914933
'python-src-import': [import_python_sources, ''],

0 commit comments

Comments
 (0)