Skip to content

Commit

Permalink
Fix missing test data for first_call
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Oct 23, 2024
1 parent 9483fb8 commit 0e22b7b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"run_id": "0tEllc387-EOK1cSx30t8",
"run_id": "6TvpVdNqD37Y9Tfu2l_Gx",
"scenario_name": "first_call",
"started_at": 1728986866,
"started_at": 1729713703,
"run_duration": 90,
"peer_count": 1,
"peer_end_count": 1,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"run_summary": {
"run_id": "0tEllc387-EOK1cSx30t8",
"run_id": "6TvpVdNqD37Y9Tfu2l_Gx",
"scenario_name": "first_call",
"started_at": 1728986866,
"started_at": 1729713703,
"run_duration": 90,
"peer_count": 1,
"peer_end_count": 1,
Expand All @@ -14,11 +14,24 @@
},
"data": {
"zome_call_timing": {
"mean": 0.01632635177744807,
"std": 0.003603250305940742,
"within_std": 0.8872,
"within_2std": 0.9407,
"within_3std": 0.9555
"mean": 0.008174,
"std": 0.001514,
"within_std": 0.6747,
"within_2std": 0.9711,
"within_3std": 0.9928,
"trend": {
"trend": [
0.006325,
0.007028,
0.007621,
0.007988,
0.008604,
0.009148,
0.009801,
0.010001
],
"window_duration": "10s"
}
}
}
}
14 changes: 10 additions & 4 deletions summariser/tests/snapshot.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use anyhow::Context;
use holochain_summariser::{execute_report_for_run_summary, model::SummaryOutput};
use std::io::BufRead;
use std::path::{Path, PathBuf};
use walkdir::{DirEntry, WalkDir};
use wind_tunnel_summary_model::{load_run_summary, load_summary_runs, RunSummary};
use wind_tunnel_summary_model::load_run_summary;

macro_rules! run_snapshot_test {
($summary_fingerprint:literal) => {
Expand Down Expand Up @@ -179,20 +178,27 @@ async fn zome_call_single_value() -> anyhow::Result<()> {
}

fn find_test_data_file(summary_fingerprint: &str, stage: &str) -> Option<DirEntry> {
WalkDir::new(
let all_matches = WalkDir::new(
Path::new(env!("CARGO_MANIFEST_DIR"))
.join("test_data")
.join(stage),
)
.into_iter()
.filter_map(|entry| entry.ok())
.find(|entry| {
.filter(|entry| {
entry
.file_name()
.to_str()
.map(|name| name.contains(summary_fingerprint))
.unwrap_or(false)
})
.collect::<Vec<_>>();

if all_matches.len() == 1 {
Some(all_matches[0].clone())
} else {
panic!("Expected exactly one match, this indicates a fingerprint collision: {:?}", all_matches);
}
}

/// Load summary output from a file
Expand Down

0 comments on commit 0e22b7b

Please sign in to comment.