Skip to content

Commit 8ffc48a

Browse files
committed
Use mx urlrewrites for Maven repo in standalone tests
1 parent 482f867 commit 8ffc48a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_standalone.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
import glob
4646

4747
is_enabled = 'ENABLE_STANDALONE_UNITTESTS' in os.environ and os.environ['ENABLE_STANDALONE_UNITTESTS'] == "true"
48-
MVN = shutil.which('mvn')
48+
MVN_CMD = [shutil.which('mvn'), '-ntp', '-e'] # No download progress bar, always show traces
49+
if 'MAVEN_REPO_OVERRIDE' in os.environ:
50+
MVN_CMD += ['-Dmaven.repo.remote=' + os.environ['MAVEN_REPO_OVERRIDE']]
4951

5052
def get_executable(file):
5153
if os.path.isfile(file):
@@ -126,7 +128,7 @@ def test_polyglot_app():
126128
print(p.stderr.decode(errors='backslashreplace'))
127129
assert "Creating polyglot java python application in directory " + target_dir in out
128130

129-
cmd = [MVN, "package", "-Pnative"]
131+
cmd = MVN_CMD + ["package", "-Pnative"]
130132
p = subprocess.run(cmd, cwd=target_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
131133
out = p.stdout.decode(errors='backslashreplace')
132134
print(out)
@@ -140,7 +142,7 @@ def test_polyglot_app():
140142
print(p.stderr.decode(errors='backslashreplace'))
141143
assert out.endswith("hello java\n")
142144

143-
cmd = [MVN, "package", "-Pjar"]
145+
cmd = MVN_CMD + ["package", "-Pjar"]
144146
p = subprocess.run(cmd, cwd=target_dir, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
145147
out = p.stdout.decode(errors='backslashreplace')
146148
print(out)

mx.graalpython/mx_graalpython.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import time
3939
from functools import wraps
4040

41+
import mx_urlrewrites
42+
4143
HPY_IMPORT_ORPHAN_BRANCH_NAME = "hpy-import"
4244

4345
if sys.version_info[0] < 3:
@@ -1484,6 +1486,7 @@ def graalpython_gate_runner(args, tasks):
14841486
with Task('GraalPython standalone module tests', tasks, tags=[GraalPythonTags.unittest_standalone]) as task:
14851487
if task:
14861488
os.environ['ENABLE_STANDALONE_UNITTESTS'] = 'true'
1489+
os.environ['MAVEN_REPO_OVERRIDE'] = mx_urlrewrites.rewriteurl('https://repo1.maven.org/maven2/')
14871490
try:
14881491
run_python_unittests(python_svm(), paths=["test_standalone.py"], javaAsserts=True, report=report())
14891492
finally:

0 commit comments

Comments
 (0)