Skip to content

Commit f7590ad

Browse files
committed
ensure jbang catalog is registered from its real location
1 parent 95fc9bb commit f7590ad

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def ensureLocalMavenRepo(self):
119119
self.fail("'org.graalvm.maven.downloader.repository' is not defined")
120120

121121
def clearCache(self):
122-
command = [JBANG_CMD, "cache", "clear"]
122+
command = [JBANG_CMD, "cache", "--verbose", "clear"]
123123
out, result = run_cmd(command)
124124

125125
def getCatalogFile(self):
@@ -163,19 +163,13 @@ def addLocalMavenRepo(self, file):
163163

164164
def registerCatalog(self, catalog_file):
165165
# we need to be sure that the current dir is not dir, where is the catalog defined
166-
167-
# find if the catalog is not registered
168-
command = [JBANG_CMD, "catalog", "list"]
166+
command = [JBANG_CMD, "catalog", "remove", "--verbose", CATALOG_ALIAS]
169167
out, result = run_cmd(command, cwd=WORK_DIR)
170-
if result == 0:
171-
if CATALOG_ALIAS not in out:
172-
# registering our catalog
173-
command = [JBANG_CMD, "catalog", "add", "--name", CATALOG_ALIAS, catalog_file]
174-
out, result = run_cmd(command, cwd=WORK_DIR)
175-
if result != 0:
176-
self.fail(f"Problem during registering catalog: {out}")
177-
else:
178-
self.fail(f"Problem during registering catalog: {out}")
168+
169+
command = [JBANG_CMD, "catalog", "add", "--verbose", "--name", CATALOG_ALIAS, catalog_file]
170+
out, result = run_cmd(command, cwd=WORK_DIR)
171+
if result != 0:
172+
self.fail(f"Problem during registering catalog: {out}")
179173

180174
def prepare_hello_example(self, work_dir):
181175
hello_java_file = os.path.join(work_dir, "hello.java")

0 commit comments

Comments
 (0)