#12958 Check if executable exists before trying to launch ResInsight

This commit is contained in:
Magne Sjaastad committed 2025-11-10 14:58:55 +01:00
1 parent d5bc4f4230
commit 3d82a00f1a
2 files changed
+12

No files matched your search

+7
View File
@@ -153,6 +153,13 @@ class Instance:
else:
resinsight_executable = resinsight_executable_from_env
# Check if executable file exists
if not os.path.isfile(resinsight_executable):
print(
f"ERROR: ResInsight executable not found at path: {resinsight_executable}"
)
return None
print("Trying to launch", resinsight_executable)
with tempfile.TemporaryDirectory() as tmp_dir_path:
port_number_file = tmp_dir_path + "/portnumber.txt"
@@ -7,6 +7,11 @@ sys.path.insert(1, os.path.join(sys.path[0], "../../"))
import rips
def test_launch_non_existing(rips_instance, initialize_test):
instance = rips.Instance.launch("non_existing", console=True)
assert instance is None
def launch_resinsight(sec=1):
resinsight_executable_from_env = os.environ.get("RESINSIGHT_EXECUTABLE")
if resinsight_executable_from_env is None: