Skip to content

Commit 0c9ed6f

Browse files
committed
Add Test w/ Precedent
1 parent d5d5190 commit 0c9ed6f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

libensemble/tests/unit_tests/test_executor.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,25 @@ def test_non_existent_app_mpi():
936936
assert 0
937937

938938

939+
def test_non_existent_app_precedent():
940+
"""Tests exception on non-existent app is not thrown if precedent is set.
941+
This is common when running apps in containers, where the executable is not
942+
check-able from the host system."""
943+
from libensemble.executors.executor import Executor
944+
945+
print(f"\nTest: {sys._getframe().f_code.co_name}\n")
946+
947+
exctr = Executor()
948+
949+
# Can register a non-existent app in case created as part of workflow.
950+
exctr.register_app(full_path=non_existent_app, app_name="nonexist")
951+
952+
w_exctr = Executor.executor # simulate on worker
953+
954+
# all should be ok
955+
w_exctr.submit(app_name="nonexist", dry_run=True)
956+
957+
939958
def test_man_signal_unrec_tag():
940959
print(f"\nTest: {sys._getframe().f_code.co_name}\n")
941960

@@ -990,5 +1009,6 @@ def test_man_signal_unrec_tag():
9901009
test_dry_run()
9911010
test_non_existent_app()
9921011
test_non_existent_app_mpi()
1012+
test_non_existent_app_precedent()
9931013
test_man_signal_unrec_tag()
9941014
teardown_module(__file__)

0 commit comments

Comments
 (0)