@@ -950,18 +950,19 @@ def get_maven_cache():
950
950
return os .path .join (SUITE .get_mx_output_dir (), 'm2_cache_' + buildnr ) if buildnr else None
951
951
952
952
def deploy_local_maven_repo ():
953
- if not DISABLE_REBUILD :
954
- env = os .environ .copy ()
955
- m2_cache = get_maven_cache ()
956
- if m2_cache :
957
- mvn_repo_local = f'-Dmaven.repo.local={ m2_cache } '
958
- maven_opts = env .get ('MAVEN_OPTS' )
959
- maven_opts = maven_opts + " " + mvn_repo_local if maven_opts else mvn_repo_local
960
- env ['MAVEN_OPTS' ] = maven_opts
961
- mx .log (f'Added { mvn_repo_local } to MAVEN_OPTS={ maven_opts } ' )
953
+ env = os .environ .copy ()
954
+ m2_cache = get_maven_cache ()
955
+ if m2_cache :
956
+ mvn_repo_local = f'-Dmaven.repo.local={ m2_cache } '
957
+ maven_opts = env .get ('MAVEN_OPTS' )
958
+ maven_opts = maven_opts + " " + mvn_repo_local if maven_opts else mvn_repo_local
959
+ env ['MAVEN_OPTS' ] = maven_opts
960
+ mx .log (f'Added { mvn_repo_local } to MAVEN_OPTS={ maven_opts } ' )
962
961
962
+ if not DISABLE_REBUILD :
963
963
# build GraalPy and all the necessary dependencies, so that we can deploy them
964
964
mx .run_mx (["build" ], env = env )
965
+
965
966
# deploy maven artifacts
966
967
version = GRAAL_VERSION
967
968
path = os .path .join (SUITE .get_mx_output_dir (), 'public-maven-repo' )
@@ -977,6 +978,7 @@ def deploy_local_maven_repo():
977
978
'local' ,
978
979
pathlib .Path (path ).as_uri (),
979
980
]
981
+
980
982
if not DISABLE_REBUILD :
981
983
mx .rmtree (path , ignore_errors = True )
982
984
os .mkdir (path )
@@ -985,7 +987,7 @@ def deploy_local_maven_repo():
985
987
mx .maven_deploy (deploy_args )
986
988
else :
987
989
mx .maven_deploy (deploy_args )
988
- return path , version
990
+ return path , version , env
989
991
990
992
991
993
def python_jvm (_ = None ):
@@ -1423,7 +1425,7 @@ def graalpython_gate_runner(args, tasks):
1423
1425
# JUnit tests with Maven
1424
1426
with Task ('GraalPython integration JUnit with Maven' , tasks , tags = [GraalPythonTags .junit_maven ]) as task :
1425
1427
if task :
1426
- mvn_repo_path , artifacts_version = deploy_local_maven_repo ()
1428
+ mvn_repo_path , artifacts_version , env = deploy_local_maven_repo ()
1427
1429
mvn_repo_path = pathlib .Path (mvn_repo_path ).as_uri ()
1428
1430
central_override = mx_urlrewrites .rewriteurl ('https://repo1.maven.org/maven2/' )
1429
1431
pom_path = os .path .join (SUITE .dir , 'graalpython/com.oracle.graal.python.test.integration/pom.xml' )
@@ -1437,9 +1439,10 @@ def graalpython_gate_runner(args, tasks):
1437
1439
mx .run_maven (mvn_cmd_base + ['dependency:purge-local-repository' , '-DreResolve=false' ])
1438
1440
1439
1441
mx .log ("Running integration JUnit tests on GraalVM SDK" )
1440
- env = extend_os_env ( JAVA_HOME = graalvm_jdk () )
1442
+ env [ 'JAVA_HOME' ] = graalvm_jdk ()
1441
1443
mx .run_maven (mvn_cmd_base + ['-U' , 'clean' , 'test' ], env = env )
1442
1444
1445
+ env ['JAVA_HOME' ] = os .environ ['JAVA_HOME' ]
1443
1446
mx .log (f"Running integration JUnit tests on vanilla JDK: { os .environ .get ('JAVA_HOME' , 'system java' )} " )
1444
1447
mx .run_maven (mvn_cmd_base + ['-U' , '-Dpolyglot.engine.WarnInterpreterOnly=false' , 'clean' , 'test' ])
1445
1448
@@ -1498,13 +1501,15 @@ def graalpython_gate_runner(args, tasks):
1498
1501
1499
1502
with Task ('GraalPython standalone module tests' , tasks , tags = [GraalPythonTags .unittest_standalone ]) as task :
1500
1503
if task :
1501
- env = {
1502
- 'ENABLE_STANDALONE_UNITTESTS' : 'true' ,
1503
- 'ENABLE_JBANG_INTEGRATION_UNITTESTS' : 'true' ,
1504
- 'JAVA_HOME' : graalvm_jdk (),
1505
- 'PYTHON_STANDALONE_HOME' : graalpy_standalone_home ('jvm' )
1506
- }
1507
- mvn_repo_path , version = deploy_local_maven_repo ()
1504
+ gvm_jdk = graalvm_jdk ()
1505
+ standalone_home = graalpy_standalone_home ('jvm' )
1506
+ mvn_repo_path , version , env = deploy_local_maven_repo ()
1507
+
1508
+ env ['ENABLE_STANDALONE_UNITTESTS' ] = 'true'
1509
+ env ['ENABLE_JBANG_INTEGRATION_UNITTESTS' ] = 'true'
1510
+ env ['JAVA_HOME' ] = gvm_jdk
1511
+ env ['PYTHON_STANDALONE_HOME' ] = standalone_home
1512
+
1508
1513
# setup maven downloader overrides
1509
1514
env ['MAVEN_REPO_OVERRIDE' ] = "," .join ([
1510
1515
f"{ pathlib .Path (mvn_repo_path ).as_uri ()} /" ,
@@ -1521,10 +1526,9 @@ def graalpython_gate_runner(args, tasks):
1521
1526
1522
1527
# run the test
1523
1528
mx .logv (f"running with os.environ extended with: { env = } " )
1524
- full_env = extend_os_env (** env )
1525
1529
mx .run ([sys .executable , _graalpytest_driver (), "-v" ,
1526
1530
"graalpython/com.oracle.graal.python.test/src/tests/standalone/test_jbang_integration.py" ,
1527
- "graalpython/com.oracle.graal.python.test/src/tests/standalone/test_standalone.py" ], env = full_env )
1531
+ "graalpython/com.oracle.graal.python.test/src/tests/standalone/test_standalone.py" ], env = env )
1528
1532
1529
1533
with Task ('GraalPython Python tests' , tasks , tags = [GraalPythonTags .tagged ]) as task :
1530
1534
if task :
0 commit comments