Skip to content

Commit b730ce0

Browse files
committed
don't run the tagged unittests with the default gate on the CI
1 parent ff063ac commit b730ce0

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,19 @@ def python3_unittests(args):
175175
mx.run(["python3", "graalpython/com.oracle.graal.python.test/src/python_unittests.py", "-v"] + args)
176176

177177

178+
def retag_unittests(args):
179+
"""run the cPython stdlib unittests"""
180+
with set_env(ENABLE_CPYTHON_TAGGED_UNITTESTS="true"):
181+
python(["graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py"] + args)
182+
183+
178184
AOT_INCOMPATIBLE_TESTS = ["test_interop.py"]
179185

180186
class GraalPythonTags(object):
181187
junit = 'python-junit'
182188
unittest = 'python-unittest'
183189
unittest_sandboxed = 'python-unittest-sandboxed'
190+
tagged = 'python-tagged-unittest'
184191
svmunit = 'python-svm-unittest'
185192
svmunit_sandboxed = 'python-svm-unittest-sandboxed'
186193
shared_object = 'python-so'
@@ -347,6 +354,11 @@ def graalpython_gate_runner(args, tasks):
347354
if task:
348355
run_python_unittests(python_gvm(["sandboxed"]), args=["--llvm.sandboxed"])
349356

357+
with Task('GraalPython Python tests', tasks, tags=[GraalPythonTags.tagged-unittest]) as task:
358+
if task:
359+
with set_env(ENABLE_CPYTHON_TAGGED_UNITTESTS="true"):
360+
gate_unittests(subdir="test_tagged_unittests.py")
361+
350362
# Unittests on SVM
351363
with Task('GraalPython tests on SVM', tasks, tags=[GraalPythonTags.svmunit]) as task:
352364
if task:
@@ -917,6 +929,7 @@ def python_coverage(args):
917929
'python-svm': [python_svm, ''],
918930
'python-gvm': [python_gvm, ''],
919931
'python-unittests': [python3_unittests, ''],
932+
'python-retag-unittests': [retag_unittests, ''],
920933
'nativebuild': [nativebuild, ''],
921934
'nativeclean': [nativeclean, ''],
922935
'python-src-import': [import_python_sources, ''],

0 commit comments

Comments
 (0)