Skip to content

Commit a0b2024

Browse files
committed
Move running polyglot isolate tests into its own gate
1 parent 5c86236 commit a0b2024

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ def nativeclean(args):
531531
class GraalPythonTags(object):
532532
junit = 'python-junit'
533533
junit_maven = 'python-junit-maven'
534+
junit_maven_isolates = 'python-junit-maven-isolates'
534535
unittest = 'python-unittest'
535536
unittest_cpython = 'python-unittest-cpython'
536537
unittest_sandboxed = 'python-unittest-sandboxed'
@@ -1189,6 +1190,29 @@ def graalpython_gate_runner(args, tasks):
11891190

11901191
# JUnit tests with Maven
11911192
with Task('GraalPython integration JUnit with Maven', tasks, tags=[GraalPythonTags.junit_maven]) as task:
1193+
if task:
1194+
mvn_repo_path, artifacts_version, env = deploy_local_maven_repo()
1195+
mvn_repo_path = pathlib.Path(mvn_repo_path).as_uri()
1196+
central_override = mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/')
1197+
pom_path = os.path.join(SUITE.dir, 'graalpython/com.oracle.graal.python.test.integration/pom.xml')
1198+
mvn_cmd_base = ['-f', pom_path,
1199+
f'-Dcom.oracle.graal.python.test.polyglot.version={artifacts_version}',
1200+
f'-Dcom.oracle.graal.python.test.polyglot_repo={mvn_repo_path}',
1201+
f'-Dcom.oracle.graal.python.test.central_repo={central_override}',
1202+
'--batch-mode']
1203+
1204+
env['PATH'] = get_path_with_patchelf()
1205+
1206+
mx.log("Running integration JUnit tests on GraalVM SDK")
1207+
env['JAVA_HOME'] = graalvm_jdk()
1208+
mx.run_maven(mvn_cmd_base + ['-U', 'clean', 'test'], env=env)
1209+
1210+
env['JAVA_HOME'] = os.environ['JAVA_HOME']
1211+
mx.log(f"Running integration JUnit tests on vanilla JDK: {os.environ.get('JAVA_HOME', 'system java')}")
1212+
mx.run_maven(mvn_cmd_base + ['-U', '-Dpolyglot.engine.WarnInterpreterOnly=false', 'clean', 'test'], env=env)
1213+
1214+
# JUnit tests with Maven and polyglot isolates
1215+
with Task('GraalPython integration JUnit with Maven and Polyglot Isolates', tasks, tags=[GraalPythonTags.junit_maven_isolates]) as task:
11921216
if task:
11931217
mvn_repo_path, artifacts_version, env = deploy_local_maven_repo(env={
11941218
"DYNAMIC_IMPORTS": "/truffle-enterprise,/substratevm-enterprise",
@@ -1206,10 +1230,6 @@ def graalpython_gate_runner(args, tasks):
12061230

12071231
env['PATH'] = get_path_with_patchelf()
12081232

1209-
mx.log("Running integration JUnit tests on GraalVM SDK")
1210-
env['JAVA_HOME'] = graalvm_jdk()
1211-
mx.run_maven(mvn_cmd_base + ['-U', 'clean', 'test'], env=env)
1212-
12131233
mx.log("Running integration JUnit tests on GraalVM SDK with external polyglot isolates")
12141234
env['JAVA_HOME'] = graalvm_jdk()
12151235
mx.run_maven(mvn_cmd_base + [
@@ -1221,10 +1241,6 @@ def graalpython_gate_runner(args, tasks):
12211241
'test'
12221242
], env=env)
12231243

1224-
env['JAVA_HOME'] = os.environ['JAVA_HOME']
1225-
mx.log(f"Running integration JUnit tests on vanilla JDK: {os.environ.get('JAVA_HOME', 'system java')}")
1226-
mx.run_maven(mvn_cmd_base + ['-U', '-Dpolyglot.engine.WarnInterpreterOnly=false', 'clean', 'test'], env=env)
1227-
12281244
# Unittests on JVM
12291245
with Task('GraalPython Python unittests', tasks, tags=[GraalPythonTags.unittest]) as task:
12301246
if task:

0 commit comments

Comments
 (0)