3838from ert .mode_definitions import TEST_RUN_MODE
3939from ert .plugins import ErtRuntimePlugins
4040from ert .run_models import create_model
41- from ert .run_models .event import RunModelWorkflowLogEvent
41+ from ert .run_models .event import WorkflowEvent
4242from ert .run_models .run_model import (
4343 RunModel ,
4444 UserCancelled ,
@@ -899,11 +899,11 @@ def _drain(status_queue):
899899
900900
901901def _persisted_workflow_events (experiment ):
902- """The workflow log events stored for an experiment, oldest first."""
902+ """The workflow events persisted to storage for an experiment, oldest first."""
903903 if not experiment .workflow_events_path .exists ():
904904 return []
905905 return [
906- RunModelWorkflowLogEvent .model_validate_json (line )
906+ WorkflowEvent .model_validate_json (line )
907907 for line in experiment .workflow_events_path .read_text (
908908 encoding = "utf-8"
909909 ).splitlines ()
@@ -929,7 +929,7 @@ def _printing_workflow(tmp_path, name, script, *, stop_on_fail=False):
929929 )
930930
931931
932- def test_that_run_workflows_sends_a_workflow_log_event_per_job (tmp_path , use_tmpdir ):
932+ def test_that_run_workflows_sends_a_workflow_event_per_job (tmp_path , use_tmpdir ):
933933 workflow = _printing_workflow (tmp_path , "hello" , 'print("hello from workflow")' )
934934 workflow .cmd_list .append (workflow .cmd_list [0 ])
935935 status_queue = SimpleQueue ()
@@ -946,11 +946,11 @@ def test_that_run_workflows_sends_a_workflow_log_event_per_job(tmp_path, use_tmp
946946 ("HELLO" , 1 , "hello from workflow\n " ),
947947 ]
948948 assert all (e .hook == "PRE_EXPERIMENT" for e in events )
949- assert all (e .run_id == brm ._workflow_log_id for e in events )
949+ assert all (e .run_id == brm ._workflow_run_id for e in events )
950950 assert not any (e .failed for e in events )
951951
952952
953- def test_that_a_workflow_log_event_is_sent_when_stop_on_fail_aborts_the_workflow (
953+ def test_that_a_workflow_event_is_sent_when_stop_on_fail_aborts_the_workflow (
954954 tmp_path , use_tmpdir
955955):
956956 workflow = _printing_workflow (
@@ -1009,7 +1009,7 @@ def test_that_a_cancelled_job_and_its_unstarted_siblings_carry_the_workflow_name
10091009 ),
10101010 ]
10111011
1012- brm ._send_workflow_log_events (
1012+ brm ._send_workflow_events (
10131013 workflow_runner = workflow_runner ,
10141014 hook = HookRuntime .PRE_SIMULATION ,
10151015 workflow_name = "my_workflow" ,
@@ -1026,7 +1026,7 @@ def test_that_a_cancelled_job_and_its_unstarted_siblings_carry_the_workflow_name
10261026 assert never_started_event .cancelled
10271027
10281028
1029- def test_that_workflow_log_events_from_an_update_hook_carry_the_iteration (
1029+ def test_that_workflow_events_from_an_update_hook_carry_the_iteration (
10301030 tmp_path , use_tmpdir
10311031):
10321032 workflow = _printing_workflow (tmp_path , "hello" , 'print("hello")' )
@@ -1119,7 +1119,7 @@ def test_that_pre_experiment_output_is_persisted_once_an_experiment_exists(
11191119 ]
11201120
11211121
1122- def test_that_a_failure_to_persist_the_workflow_log_does_not_stop_the_experiment (
1122+ def test_that_a_failure_to_persist_workflow_events_does_not_stop_the_experiment (
11231123 tmp_path , use_tmpdir , caplog
11241124):
11251125 workflow = _printing_workflow (tmp_path , "hello" , 'print("hello from workflow")' )
@@ -1143,7 +1143,7 @@ def test_that_a_failure_to_persist_the_workflow_log_does_not_stop_the_experiment
11431143 )
11441144 )
11451145
1146- assert "Failed to persist workflow log " in caplog .text
1146+ assert "Failed to persist workflow events to storage " in caplog .text
11471147 assert _drain (status_queue ), "the event should still be sent"
11481148
11491149
@@ -1181,14 +1181,14 @@ def test_that_starting_an_experiment_discards_workflow_output_from_the_previous_
11811181 brm = create_run_model ()
11821182 brm ._status_queue = SimpleQueue ()
11831183 brm ._pending_workflow_events = [MagicMock ()]
1184- previous_log_id = brm ._workflow_log_id
1184+ previous_log_id = brm ._workflow_run_id
11851185
11861186 brm .start_simulations_thread (
11871187 EvaluatorServerConfig (use_token = False ), rerun_failed_realizations = True
11881188 )
11891189
11901190 assert brm ._pending_workflow_events == []
1191- assert brm ._workflow_log_id != previous_log_id
1191+ assert brm ._workflow_run_id != previous_log_id
11921192
11931193
11941194def test_that_workflow_output_is_persisted_when_stop_on_fail_aborts_the_workflow (
@@ -1266,7 +1266,7 @@ def test_that_workflows_hooked_after_a_cancelled_one_still_appear_as_cancelled(
12661266 """Regression test: when several workflows are hooked to the same
12671267 runtime and cancellation happens while the first one is running, the
12681268 workflows that come after it in the hook's list must still be reported
1269- (as cancelled) rather than silently disappearing from the workflow log .
1269+ (as cancelled) rather than silently disappearing from the workflow events .
12701270 """
12711271 first = _printing_workflow (tmp_path , "first" , 'print("first workflow")' )
12721272 second = _printing_workflow (tmp_path , "second" , 'print("second workflow")' )
0 commit comments