4545import glob
4646
4747is_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
5052def 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 )
0 commit comments