mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 16:01:42 +00:00
fix: fix mocking for workflows
This commit is contained in:
@@ -12,7 +12,6 @@ use std::{
|
||||
};
|
||||
|
||||
use serde::{self, Deserialize, Serialize, Serializer};
|
||||
use serde_json::value::RawValue;
|
||||
|
||||
use crate::{
|
||||
more_serde::{
|
||||
@@ -176,7 +175,7 @@ pub struct Suspend {
|
||||
pub struct Mock {
|
||||
pub enabled: bool,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub return_value: Option<Box<RawValue>>,
|
||||
pub return_value: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||
|
||||
@@ -1448,13 +1448,15 @@ async fn push_next_flow_job<R: rsmq_async::RsmqConnection + Send + Sync + Clone>
|
||||
let mut hm = HashMap::new();
|
||||
hm.insert(
|
||||
"previous_result".to_string(),
|
||||
module
|
||||
.mock
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.return_value
|
||||
.clone()
|
||||
.unwrap_or_else(|| serde_json::from_str("null").unwrap()),
|
||||
to_raw_value(
|
||||
&module
|
||||
.mock
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.return_value
|
||||
.clone()
|
||||
.unwrap_or_else(|| serde_json::from_str("null").unwrap()),
|
||||
),
|
||||
);
|
||||
Ok(hm)
|
||||
} else if let Some(id) = get_args_from_id {
|
||||
|
||||
Reference in New Issue
Block a user