diff --git a/spi/spi-stats/tests/test_stats.rs b/spi/spi-stats/tests/test_stats.rs index 4be5ab73a..63ab6b851 100644 --- a/spi/spi-stats/tests/test_stats.rs +++ b/spi/spi-stats/tests/test_stats.rs @@ -52,7 +52,7 @@ async fn init_data() -> TardisResult<()> { ..Default::default() }; - let mut client = TestHttpClient::new(format!("https://127.0.0.1:8080/{}", DOMAIN_CODE)); + let mut client = TestHttpClient::new(format!("http://localhost:8080/{}", DOMAIN_CODE)); client.set_auth(&ctx)?; diff --git a/spi/spi-stats/tests/test_stats_record.rs b/spi/spi-stats/tests/test_stats_record.rs index 49c364cee..d729b1ece 100644 --- a/spi/spi-stats/tests/test_stats_record.rs +++ b/spi/spi-stats/tests/test_stats_record.rs @@ -111,7 +111,8 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { &StatsFactRecordLoadReq { own_paths: "t1/a1".to_string(), ct: Utc::now(), - data: json!({}) + data: json!({}), + ext: json!({}) }, ) .await @@ -127,9 +128,8 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { &StatsFactRecordLoadReq { own_paths: "t1/a1".to_string(), ct: Utc::now(), - data: json!({ - "xx": 1 - }) + data: json!({"xx":1}), + ext: json!({"xx":1}) }, ) .await @@ -147,6 +147,9 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { ct: Utc::now(), data: json!({ "status": "openxxx" + }), + ext: json!({ + "status": "openxxx" }) }, ) @@ -165,6 +168,9 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { ct: Utc::now(), data: json!({ "status": "open" + }), + ext: json!({ + "status": "open" }) }, ) @@ -188,6 +194,15 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { "act_hours": 40, "plan_hours": 45 }), + ext: json!({ + "source":"zhejiang", + "status": "open", + "priority":1, + "tag":["t1","t2"], + "creator":"acc001", + "act_hours": 40, + "plan_hours": 45 + }), }, ) .await; @@ -206,6 +221,15 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { "act_hours": 15, "plan_hours": 10 }), + ext: json!({ + "source":"hangzhou", + "status": "open", + "priority":2, + "tag":["t1"], + "creator":"acc002", + "act_hours": 15, + "plan_hours": 10 + }), }, ) .await; @@ -224,6 +248,9 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { data: json!({ "status": "progress", }), + ext: json!({ + "status": "progress", + }), }, ) .await; @@ -237,6 +264,9 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { data: json!({ "priority": 1, }), + ext: json!({ + "priority": 1, + }), }, ) .await; @@ -252,7 +282,8 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { key: "rec3".to_string(), own_paths: "t1/a1".to_string(), ct: Utc::now(), - data: json!({}) + data: json!({}), + ext: json!({}) }], ) .await @@ -269,7 +300,8 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { key: "rec3".to_string(), own_paths: "t1/a1".to_string(), ct: Utc::now(), - data: json!({}) + data: json!({}), + ext: json!({}) }], ) .await @@ -319,6 +351,15 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { "act_hours": 40, "plan_hours": 45 }), + ext: json!({ + "source":"zhejiang", + "status": "open", + "priority":1, + "tag":["t1","t2"], + "creator":"acc001", + "act_hours": 40, + "plan_hours": 45 + }), }, StatsFactRecordsLoadReq { key: "rec4".to_string(), @@ -333,6 +374,15 @@ pub async fn test_fact_record(client: &mut TestHttpClient) -> TardisResult<()> { "act_hours": 40, "plan_hours": 45 }), + ext: json!({ + "source":"zhejiang", + "status": "open", + "priority":2, + "tag":["t1","t2"], + "creator":"acc001", + "act_hours": 40, + "plan_hours": 45 + }), }, ], )