Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions crates/taurus-core/src/runtime/engine.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -308,10 +308,8 @@ mod tests {
use tucana::aquila::{ActionExecutionRequest, ActionNodeSubFlowValue, action_node_value};
use tucana::shared::{
InputType, ListValue, NodeExecutionResult, NodeParameter, NodeValue, ReferenceValue,
Struct, SubFlow, SubFlowFunction, SubFlowSetting, Value, node_execution_result,
node_value, reference_value,
sub_flow::ExecutionReference,
value::Kind,
Struct, SubFlow, SubFlowFunction, SubFlowSetting, Value, node_execution_result, node_value,
reference_value, sub_flow::ExecutionReference, value::Kind,
};

fn literal_param(database_id: i64, runtime_parameter_id: &str, value: Value) -> NodeParameter {
Expand DownExpand Up@@ -925,7 +923,8 @@ mod tests {
None,
);

let (signal, reason) = engine.execute_graph("test", 1, vec![filter_node], None, None, false);
let (signal, reason) =
engine.execute_graph("test", 1, vec![filter_node], None, None, false);

assert_eq!(reason, ExitReason::Success);
assert_eq!(
Expand DownExpand Up@@ -1218,7 +1217,8 @@ mod tests {
None,
);

let report = engine.execute_graph_report("test", 1, vec![value_node, add_node], None, None, false);
let report =
engine.execute_graph_report("test", 1, vec![value_node, add_node], None, None, false);

assert_eq!(report.exit_reason, ExitReason::Success);
assert_eq!(report.node_execution_results.len(), 2);
Expand DownExpand Up@@ -1260,7 +1260,8 @@ mod tests {
);
remote_node.definition_source = Some("remote-service".to_string());

let report = engine.execute_graph_report("test", 1, vec![remote_node], None, Some(&remote), false);
let report =
engine.execute_graph_report("test", 1, vec![remote_node], None, Some(&remote), false);

assert_eq!(report.exit_reason, ExitReason::Failure);
match report.signal {
Expand DownExpand Up@@ -1306,7 +1307,8 @@ mod tests {
);
remote_node.definition_source = Some("action.example".to_string());

let report = engine.execute_graph_report("test", 1, vec![remote_node], None, Some(&remote), false);
let report =
engine.execute_graph_report("test", 1, vec![remote_node], None, Some(&remote), false);

assert_eq!(report.exit_reason, ExitReason::Success);
assert_eq!(
Expand DownExpand Up@@ -1711,8 +1713,14 @@ mod tests {
None,
);

let report =
engine.execute_graph_report("test", 1, vec![for_each_node, callback_node], None, None, false);
let report = engine.execute_graph_report(
"test",
1,
vec![for_each_node, callback_node],
None,
None,
false,
);

assert_eq!(report.exit_reason, ExitReason::Success);
assert_eq!(report.node_execution_results.len(), 4);
Expand DownExpand Up@@ -1796,8 +1804,14 @@ mod tests {
);
for_each_node.definition_source = Some("draco-draco-cron".to_string());

let report =
engine.execute_graph_report("test", 2, vec![value_node, for_each_node], None, None, false);
let report = engine.execute_graph_report(
"test",
2,
vec![value_node, for_each_node],
None,
None,
false,
);

assert_eq!(report.exit_reason, ExitReason::Success);
assert_eq!(expect_success(report.signal), response_value);
Expand Down
24 changes: 12 additions & 12 deletions crates/taurus-core/src/runtime/engine/executor.rs
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,18 +2,6 @@

use std::sync::{Arc, Mutex};

use futures_lite::future::block_on;
use tokio::sync::Notify;
use tucana::aquila::{
ActionExecutionRequest, ActionNodeSubFlowValue, ActionNodeValue, action_node_value,
};
use tucana::shared::node_execution_result::Result as TucanaNodeResult;
use tucana::shared::reference_value::Target;
use tucana::shared::value::Kind;
use tucana::shared::{
InputType, NodeExecutionResult as TucanaNodeExecutionResult, NodeParameterNodeExecutionResult,
ReferenceValue, SubFlowSetting, Value,
};
use crate::handler::argument::{Argument, FunctionThunk, ParameterNode, Thunk};
use crate::handler::registry::{FunctionStore, HandlerFunctionEntry};
use crate::runtime::engine::model::{
Expand All@@ -29,6 +17,18 @@ use crate::runtime::remote::{RemoteExecution, RemoteRuntime};
use crate::time::now_unix_micros;
use crate::types::errors::runtime_error::RuntimeError;
use crate::types::signal::Signal;
use futures_lite::future::block_on;
use tokio::sync::Notify;
use tucana::aquila::{
ActionExecutionRequest, ActionNodeSubFlowValue, ActionNodeValue, action_node_value,
};
use tucana::shared::node_execution_result::Result as TucanaNodeResult;
use tucana::shared::reference_value::Target;
use tucana::shared::value::Kind;
use tucana::shared::{
InputType, NodeExecutionResult as TucanaNodeExecutionResult, NodeParameterNodeExecutionResult,
ReferenceValue, SubFlowSetting, Value,
};

/// Executes a compiled flow plan starting at `start_idx` -- used both by a
/// normal top-level run (`start_idx == flow.start_idx`) and by the
Expand Down
Loading