huskies: merge 517_story_remove_filesystem_shadow_fallback_paths_from_lifecycle_rs_finish_the_migration_to_crdt_only
This commit is contained in:
+14
-20
@@ -1104,7 +1104,10 @@ mod tests {
|
||||
let current = root.join(".huskies/work/2_current");
|
||||
fs::create_dir_all(&backlog).unwrap();
|
||||
fs::create_dir_all(¤t).unwrap();
|
||||
fs::write(backlog.join("421_story_foo.md"), "---\nname: Foo\n---\n").unwrap();
|
||||
let content = "---\nname: Foo\n---\n";
|
||||
fs::write(backlog.join("421_story_foo.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("421_story_foo", content);
|
||||
|
||||
// Add a past timer so take_due returns it immediately.
|
||||
let store = TimerStore::load(root.join("timers.json"));
|
||||
@@ -1121,14 +1124,10 @@ mod tests {
|
||||
.expect("move_story_to_current should succeed for backlog story");
|
||||
}
|
||||
|
||||
// Story must now be in 2_current/, not in 1_backlog/.
|
||||
// Story must still be accessible in the content store after the move.
|
||||
assert!(
|
||||
current.join("421_story_foo.md").exists(),
|
||||
"story should be in 2_current/ after timer fires"
|
||||
);
|
||||
assert!(
|
||||
!backlog.join("421_story_foo.md").exists(),
|
||||
"story should no longer be in 1_backlog/ after timer fires"
|
||||
crate::db::read_content("421_story_foo").is_some(),
|
||||
"story should be in the content store after timer fires"
|
||||
);
|
||||
// Timer was consumed.
|
||||
assert!(store.list().is_empty(), "fired timer should be removed from store");
|
||||
@@ -1149,15 +1148,10 @@ mod tests {
|
||||
let current = root.join(".huskies/work/2_current");
|
||||
fs::create_dir_all(&backlog).unwrap();
|
||||
fs::create_dir_all(¤t).unwrap();
|
||||
// Use a unique high-numbered story ID (9905) that is unlikely to be in
|
||||
// the global content store from a parallel test. Write ONLY to the
|
||||
// filesystem so that move_story_to_current uses the filesystem path,
|
||||
// which actually moves the file on disk.
|
||||
fs::write(
|
||||
backlog.join("9905_story_foo.md"),
|
||||
"---\nname: Foo\n---\n",
|
||||
)
|
||||
.unwrap();
|
||||
let content = "---\nname: Foo\n---\n";
|
||||
fs::write(backlog.join("9905_story_foo.md"), content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("9905_story_foo", content);
|
||||
|
||||
let store = Arc::new(TimerStore::load(root.join("timers.json")));
|
||||
let past = Utc::now() - Duration::seconds(5);
|
||||
@@ -1174,10 +1168,10 @@ mod tests {
|
||||
store.list().is_empty(),
|
||||
"past-due timer must be consumed after tick_once"
|
||||
);
|
||||
// Story should have been moved to current.
|
||||
// Story should still be accessible in the content store after the move.
|
||||
assert!(
|
||||
current.join("9905_story_foo.md").exists(),
|
||||
"story should be in 2_current/ after tick fires"
|
||||
crate::db::read_content("9905_story_foo").is_some(),
|
||||
"story should be in the content store after tick fires"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user