Reapply "More aggressive using of cache on engine settings changes" (#4736)

* Reapply "More aggressive using of cache on engine settings changes (#4691)" (#4729)

This reverts commit 3f1f40eeba.

* Add a utility to get all the current values from the settings object

* Use an XState selector to get the latest settings snapshot for WASM

---------

Co-authored-by: Frank Noirot <frank@kittycad.io>
This commit is contained in:
Jess Frazelle
2024-12-10 18:50:22 -08:00
committed by GitHub
parent 53d40301dc
commit 3049f405f5
36 changed files with 976 additions and 625 deletions

View File

@ -1,3 +1,5 @@
mod cache;
use kcl_lib::{
test_server::{execute_and_snapshot, execute_and_snapshot_no_auth},
UnitLength,
@ -5,7 +7,7 @@ use kcl_lib::{
/// The minimum permissible difference between asserted twenty-twenty images.
/// i.e. how different the current model snapshot can be from the previous saved one.
const MIN_DIFF: f64 = 0.99;
pub(crate) const MIN_DIFF: f64 = 0.99;
macro_rules! kcl_input {
($file:literal) => {
@ -13,8 +15,11 @@ macro_rules! kcl_input {
};
}
fn assert_out(test_name: &str, result: &image::DynamicImage) {
twenty_twenty::assert_image(format!("tests/executor/outputs/{test_name}.png"), result, MIN_DIFF);
pub(crate) fn assert_out(test_name: &str, result: &image::DynamicImage) -> String {
let path = format!("tests/executor/outputs/{test_name}.png");
twenty_twenty::assert_image(&path, result, MIN_DIFF);
path
}
#[tokio::test(flavor = "multi_thread")]