Skip to content

Commit 62fe613

Browse files
committed
added post merge jobs for long running graalpy gradle and maven plugin tests
1 parent 5a6b30c commit 62fe613

File tree

6 files changed

+87
-43
lines changed

6 files changed

+87
-43
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "80c82ac2e9a0455373dc290cffb8f3fac2ebe4f7" }
1+
{ "overlay": "b78a4cdbe55c57fc0148bf3fff9ba2ade3f1d2d2" }

graalpython/com.oracle.graal.python.test/src/tests/conftest.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22
run_top_level_functions = true
33

44
[[test_rules]]
5-
selector = ['standalone/*']
5+
selector = [
6+
"standalone/test_jbang_integration.py",
7+
"standalone/test_standalone.py"]
68
per_test_timeout = 2400
79
partial_splits_individual_tests = true
810

11+
[[test_rules]]
12+
selector = [
13+
"standalone/test_gradle_plugin.py",
14+
"standalone/test_maven_plugin.py"]
15+
per_test_timeout = 3600
16+
partial_splits_individual_tests = true
17+
918
[[test_rules]]
1019
# Windows support is still experimental, so we exclude some unittests
1120
# on Windows for now. If you add unittests and cannot get them to work

graalpython/com.oracle.graal.python.test/src/tests/standalone/test_gradle_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def test_gradle_gen_launcher_and_venv(self):
386386
def test_gradle_check_home_warning(self):
387387
self.check_gradle_check_home_warning(community=True)
388388

389-
@unittest.skipUnless(util.is_gradle_plugin_test_enabled, "ENABLE_GRADLE_PLUGIN_UNITTESTS is not true")
389+
@unittest.skipUnless(util.is_gradle_plugin_long_running_test_enabled, "ENABLE_GRADLE_PLUGIN_LONG_RUNNING_UNITTESTS is not true")
390390
def test_gradle_check_home(self):
391391
self.check_gradle_check_home(community=True)
392392

@@ -514,7 +514,7 @@ def test_gradle_gen_launcher_and_venv(self):
514514
def test_gradle_check_home_warning(self):
515515
self.check_gradle_check_home_warning(community=True)
516516

517-
@unittest.skipUnless(util.is_gradle_plugin_test_enabled, "ENABLE_GRADLE_PLUGIN_UNITTESTS is not true")
517+
@unittest.skipUnless(util.is_gradle_plugin_long_running_test_enabled, "ENABLE_GRADLE_PLUGIN_LONG_RUNNING_UNITTESTS is not true")
518518
def test_gradle_check_home(self):
519519
self.check_gradle_check_home(community=True)
520520

graalpython/com.oracle.graal.python.test/src/tests/standalone/test_maven_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def test_check_home_warning(self):
261261
util.check_ouput("BUILD SUCCESS", out)
262262
util.check_ouput("the python language home is always available", out, contains=True)
263263

264-
@unittest.skipUnless(util.is_maven_plugin_test_enabled, "ENABLE_MAVEN_PLUGIN_UNITTESTS is not true")
264+
@unittest.skipUnless(util.is_maven_plugin_long_running_test_enabled, "ENABLE_MAVEN_PLUGIN_LONG_RUNNING_UNITTESTS is not true")
265265
def test_check_home(self):
266266
with TemporaryTestDirectory() as tmpdir:
267267
target_name = "check_home_test"

graalpython/com.oracle.graal.python.test/src/tests/standalone/util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@
5555
VFS_PREFIX = "org.graalvm.python.vfs"
5656

5757
is_maven_plugin_test_enabled = 'ENABLE_MAVEN_PLUGIN_UNITTESTS' in os.environ and os.environ['ENABLE_MAVEN_PLUGIN_UNITTESTS'] == "true"
58+
is_maven_plugin_long_running_test_enabled = 'ENABLE_MAVEN_PLUGIN_LONG_RUNNING_UNITTESTS' in os.environ and os.environ['ENABLE_MAVEN_PLUGIN_LONG_RUNNING_UNITTESTS'] == "true"
5859
is_gradle_plugin_test_enabled = 'ENABLE_GRADLE_PLUGIN_UNITTESTS' in os.environ and os.environ['ENABLE_GRADLE_PLUGIN_UNITTESTS'] == "true"
59-
60+
is_gradle_plugin_long_running_test_enabled = 'ENABLE_GRADLE_PLUGIN_LONG_RUNNING_UNITTESTS' in os.environ and os.environ['ENABLE_GRADLE_PLUGIN_LONG_RUNNING_UNITTESTS'] == "true"
6061

6162
class TemporaryTestDirectory():
6263
def __init__(self):
@@ -113,7 +114,8 @@ def log(self, msg, newline=True):
113114
class BuildToolTestBase(unittest.TestCase):
114115
@classmethod
115116
def setUpClass(cls):
116-
if not is_maven_plugin_test_enabled and not is_gradle_plugin_test_enabled:
117+
if (not is_maven_plugin_test_enabled and not is_gradle_plugin_test_enabled
118+
and not is_maven_plugin_long_running_test_enabled and not is_gradle_plugin_long_running_test_enabled):
117119
return
118120

119121
cls.env = os.environ.copy()

mx.graalpython/mx_graalpython.py

Lines changed: 69 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ class GraalPythonTags(object):
492492
unittest_posix = 'python-unittest-posix'
493493
unittest_standalone = 'python-unittest-standalone'
494494
unittest_gradle_plugin = 'python-unittest-gradle-plugin'
495+
unittest_gradle_plugin_long_run = 'python-unittest-gradle-plugin-long-run'
495496
unittest_maven_plugin = 'python-unittest-maven-plugin'
497+
unittest_maven_plugin_long_run = 'python-unittest-maven-plugin-long-run'
496498
tagged = 'python-tagged-unittest'
497499
svmunit = 'python-svm-unittest'
498500
svmunit_sandboxed = 'python-svm-unittest-sandboxed'
@@ -1151,6 +1153,47 @@ def get_wrapper_urls(wrapper_properties_file, keys):
11511153

11521154
return ret
11531155

1156+
def setup_graalpy_plugin_tests():
1157+
gvm_jdk = graalvm_jdk()
1158+
standalone_home = graalpy_standalone_home('jvm')
1159+
mvn_repo_path, version, env = deploy_local_maven_repo()
1160+
1161+
env['JAVA_HOME'] = gvm_jdk
1162+
env['PYTHON_STANDALONE_HOME'] = standalone_home
1163+
1164+
# setup maven downloader overrides
1165+
env['MAVEN_REPO_OVERRIDE'] = ",".join([
1166+
f"{pathlib.Path(mvn_repo_path).as_uri()}/",
1167+
mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/'),
1168+
])
1169+
1170+
env["org.graalvm.maven.downloader.version"] = version
1171+
env["org.graalvm.maven.downloader.repository"] = f"{pathlib.Path(mvn_repo_path).as_uri()}/"
1172+
1173+
return standalone_home, env
1174+
1175+
def setup_maven_plugin_tests():
1176+
standalone_home, env = setup_graalpy_plugin_tests()
1177+
1178+
override_path = os.path.join(SUITE.get_mx_output_dir(), 'maven-properties-override')
1179+
original_props_file = "graalpython/com.oracle.graal.python.test/src/tests/standalone/mvnw/.mvn/wrapper/maven-wrapper.properties"
1180+
mx.copyfile(original_props_file, override_path)
1181+
mx_graalpython_gradleproject.patch_distribution_url(override_path, original_props_file, escape_colon=False)
1182+
env['MAVEN_PROPERTIES_OVERRIDE'] = override_path
1183+
1184+
return standalone_home, env
1185+
1186+
def setup_gradle_plugin_tests():
1187+
standalone_home, env = setup_graalpy_plugin_tests()
1188+
1189+
override_path = os.path.join(SUITE.get_mx_output_dir(), 'gradle-properties-override')
1190+
original_props_file = "graalpython/com.oracle.graal.python.test/src/tests/standalone/gradle/gradle-test-project/gradle/wrapper/gradle-wrapper.properties"
1191+
mx.copyfile(original_props_file, override_path)
1192+
mx_graalpython_gradleproject.patch_distribution_url(override_path, original_props_file)
1193+
env['GRADLE_PROPERTIES_OVERRIDE'] = override_path
1194+
1195+
return standalone_home, env
1196+
11541197
def graalpython_gate_runner(args, tasks):
11551198
report = lambda: (not is_collecting_coverage()) and task
11561199
nonZeroIsFatal = not is_collecting_coverage()
@@ -1285,28 +1328,23 @@ def graalpython_gate_runner(args, tasks):
12851328

12861329
with Task('GraalPython gradle plugin tests', tasks, tags=[GraalPythonTags.unittest_gradle_plugin]) as task:
12871330
if task:
1288-
gvm_jdk = graalvm_jdk()
1289-
standalone_home = graalpy_standalone_home('jvm')
1290-
mvn_repo_path, version, env = deploy_local_maven_repo()
1291-
1331+
standalone_home, env = setup_gradle_plugin_tests()
12921332
env['ENABLE_GRADLE_PLUGIN_UNITTESTS'] = 'true'
1293-
env['JAVA_HOME'] = gvm_jdk
1294-
env['PYTHON_STANDALONE_HOME'] = standalone_home
12951333

1296-
# setup maven downloader overrides
1297-
env['MAVEN_REPO_OVERRIDE'] = ",".join([
1298-
f"{pathlib.Path(mvn_repo_path).as_uri()}/",
1299-
mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/'),
1300-
])
1334+
# run the test
1335+
mx.logv(f"running with os.environ extended with: {env=}")
13011336

1302-
override_path = os.path.join(SUITE.get_mx_output_dir(), 'gradle-properties-override')
1303-
original_props_file = "graalpython/com.oracle.graal.python.test/src/tests/standalone/gradle/gradle-test-project/gradle/wrapper/gradle-wrapper.properties"
1304-
mx.copyfile(original_props_file, override_path)
1305-
mx_graalpython_gradleproject.patch_distribution_url(override_path, original_props_file)
1306-
env['GRADLE_PROPERTIES_OVERRIDE'] = override_path
1337+
run_python_unittests(
1338+
os.path.join(standalone_home, 'bin', _graalpy_launcher()),
1339+
paths=["graalpython/com.oracle.graal.python.test/src/tests/standalone/test_gradle_plugin.py"],
1340+
env=env,
1341+
parallel=3,
1342+
)
13071343

1308-
env["org.graalvm.maven.downloader.version"] = version
1309-
env["org.graalvm.maven.downloader.repository"] = f"{pathlib.Path(mvn_repo_path).as_uri()}/"
1344+
with Task('GraalPython gradle plugin long running tests', tasks, tags=[GraalPythonTags.unittest_gradle_plugin_long_run]) as task:
1345+
if task:
1346+
standalone_home, env = setup_gradle_plugin_tests()
1347+
env['ENABLE_GRADLE_PLUGIN_LONG_RUNNING_UNITTESTS'] = 'true'
13101348

13111349
# run the test
13121350
mx.logv(f"running with os.environ extended with: {env=}")
@@ -1320,28 +1358,23 @@ def graalpython_gate_runner(args, tasks):
13201358

13211359
with Task('GraalPython maven plugin tests', tasks, tags=[GraalPythonTags.unittest_maven_plugin]) as task:
13221360
if task:
1323-
gvm_jdk = graalvm_jdk()
1324-
standalone_home = graalpy_standalone_home('jvm')
1325-
mvn_repo_path, version, env = deploy_local_maven_repo()
1326-
1361+
standalone_home, env = setup_maven_plugin_tests()
13271362
env['ENABLE_MAVEN_PLUGIN_UNITTESTS'] = 'true'
1328-
env['JAVA_HOME'] = gvm_jdk
1329-
env['PYTHON_STANDALONE_HOME'] = standalone_home
13301363

1331-
# setup maven downloader overrides
1332-
env['MAVEN_REPO_OVERRIDE'] = ",".join([
1333-
f"{pathlib.Path(mvn_repo_path).as_uri()}/",
1334-
mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/'),
1335-
])
1364+
# run the test
1365+
mx.logv(f"running with os.environ extended with: {env=}")
13361366

1337-
override_path = os.path.join(SUITE.get_mx_output_dir(), 'maven-properties-override')
1338-
original_props_file = "graalpython/com.oracle.graal.python.test/src/tests/standalone/mvnw/.mvn/wrapper/maven-wrapper.properties"
1339-
mx.copyfile(original_props_file, override_path)
1340-
mx_graalpython_gradleproject.patch_distribution_url(override_path, original_props_file, escape_colon=False)
1341-
env['MAVEN_PROPERTIES_OVERRIDE'] = override_path
1367+
run_python_unittests(
1368+
os.path.join(standalone_home, 'bin', _graalpy_launcher()),
1369+
paths=["graalpython/com.oracle.graal.python.test/src/tests/standalone/test_maven_plugin.py"],
1370+
env=env,
1371+
parallel=3,
1372+
)
13421373

1343-
env["org.graalvm.maven.downloader.version"] = version
1344-
env["org.graalvm.maven.downloader.repository"] = f"{pathlib.Path(mvn_repo_path).as_uri()}/"
1374+
with Task('GraalPython maven plugin long runnning tests', tasks, tags=[GraalPythonTags.unittest_maven_plugin_long_run]) as task:
1375+
if task:
1376+
standalone_home, env = setup_maven_plugin_tests()
1377+
env['ENABLE_MAVEN_PLUGIN_LONG_RUNNING_UNITTESTS'] = 'true'
13451378

13461379
# run the test
13471380
mx.logv(f"running with os.environ extended with: {env=}")

0 commit comments

Comments
 (0)