Add building the artifact graph in sketch mode, take 2 (#7557)
* Add building the artifact graph in mock execution * Update output * Add updating the artifact graph after mock execution * Fix spelling * Fix to return it all the way * Fix to not make artifact fields undefined in TS
This commit is contained in:
@ -2286,6 +2286,25 @@ w = f() + f()
|
||||
ctx2.close().await;
|
||||
}
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn mock_has_stable_ids() {
|
||||
let ctx = ExecutorContext::new_mock(None).await;
|
||||
let code = "sk = startSketchOn(XY)
|
||||
|> startProfile(at = [0, 0])";
|
||||
let program = crate::Program::parse_no_errs(code).unwrap();
|
||||
let result = ctx.run_mock(program, false).await.unwrap();
|
||||
let ids = result.artifact_graph.iter().map(|(k, _)| *k).collect::<Vec<_>>();
|
||||
assert!(!ids.is_empty(), "IDs should not be empty");
|
||||
|
||||
let ctx2 = ExecutorContext::new_mock(None).await;
|
||||
let program2 = crate::Program::parse_no_errs(code).unwrap();
|
||||
let result = ctx2.run_mock(program2, false).await.unwrap();
|
||||
let ids2 = result.artifact_graph.iter().map(|(k, _)| *k).collect::<Vec<_>>();
|
||||
|
||||
assert_eq!(ids, ids2, "Generated IDs should match");
|
||||
}
|
||||
|
||||
#[cfg(feature = "artifact-graph")]
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn sim_sketch_mode_real_mock_real() {
|
||||
|
Reference in New Issue
Block a user