huskies: merge 492_story_remove_filesystem_pipeline_state_and_store_story_content_in_database
This commit is contained in:
@@ -1177,7 +1177,8 @@ allowed_tools = ["Read", "Bash"]
|
||||
std::fs::create_dir_all(root.join(".huskies").join("work").join(stage)).unwrap();
|
||||
}
|
||||
|
||||
// Write a story file with persisted test results.
|
||||
// Use a unique high-numbered story ID to avoid collisions with the
|
||||
// "42_story_foo" entry used by get_test_results_returns_none_when_no_results.
|
||||
let story_content = r#"---
|
||||
name: "Test story"
|
||||
---
|
||||
@@ -1188,15 +1189,20 @@ name: "Test story"
|
||||
<!-- huskies-test-results: {"unit":[{"name":"from_file","status":"pass","details":null}],"integration":[]} -->
|
||||
"#;
|
||||
std::fs::write(
|
||||
root.join(".huskies/work/2_current/42_story_foo.md"),
|
||||
root.join(".huskies/work/2_current/9906_story_persisted_results.md"),
|
||||
story_content,
|
||||
)
|
||||
.unwrap();
|
||||
// Also write to the content store so read_story_content returns this
|
||||
// test's content even when another test left a stale entry in the
|
||||
// global content store.
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("9906_story_persisted_results", story_content);
|
||||
|
||||
let ctx = AppContext::new_test(root);
|
||||
let api = AgentsApi { ctx: Arc::new(ctx) };
|
||||
let result = api
|
||||
.get_test_results(Path("42_story_foo".to_string()))
|
||||
.get_test_results(Path("9906_story_persisted_results".to_string()))
|
||||
.await
|
||||
.unwrap()
|
||||
.0
|
||||
|
||||
Reference in New Issue
Block a user