Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(flows): update draft write-back test for layout 2 storage

Steven Enamakela5fec945dcf3
diff --git a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
index 25049f7cf2..5b6fcc3073 100644
--- a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
@@ -363,16 +363,17 @@ async fn edit_workflow_surfaces_draft_write_back_failure() {
let conn =
crate::storage::rusqlite::Connection::open(config.workspace_dir.join("storage/storage.db"))
.unwrap();
+ // Layout 2 keeps every scope's documents in the `docs` table.
let docs_table: String = conn
.query_row(
- "SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE '%\\_tsd\\_docs' ESCAPE '\\'",
+ "SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'docs'",
[],
|row| row.get(0),
)
.unwrap();
conn.execute_batch(&format!(
"CREATE TRIGGER refuse_draft_updates BEFORE UPDATE ON {docs_table}
- WHEN NEW.coll = 'flows_drafts'
+ WHEN NEW.coll = 'flows.drafts'
BEGIN SELECT RAISE(ABORT, 'drafts are read-only'); END;"
))
.unwrap();