()
| 92 | |
| 93 | #[tokio::test] |
| 94 | async fn document_roundtrip() { |
| 95 | let server = TestServer::start().await; |
| 96 | server |
| 97 | .exec( |
| 98 | "CREATE COLLECTION wire_docs \ |
| 99 | (id TEXT PRIMARY KEY, content TEXT) WITH (engine='document_strict')", |
| 100 | ) |
| 101 | .await |
| 102 | .ok(); |
| 103 | server |
| 104 | .exec("INSERT INTO wire_docs (id, content) VALUES ('a','alpha')") |
| 105 | .await |
| 106 | .expect("insert a"); |
| 107 | server |
| 108 | .exec("INSERT INTO wire_docs (id, content) VALUES ('b','beta')") |
| 109 | .await |
| 110 | .expect("insert b"); |
| 111 | |
| 112 | let bytes = drain_backup(&server, TENANT).await.expect("BACKUP"); |
| 113 | |
| 114 | // Restore over the *same* server is a valid sanity check — restore is |
| 115 | // idempotent at the engine level (PointPut overwrites). |
| 116 | push_restore(&server, TENANT, bytes, false) |
| 117 | .await |
| 118 | .expect("RESTORE"); |
| 119 | |
| 120 | let rows = server |
| 121 | .query_text("SELECT content FROM wire_docs WHERE id='a'") |
| 122 | .await |
| 123 | .expect("post-restore SELECT"); |
| 124 | assert!( |
| 125 | rows.iter().any(|r| r.contains("alpha")), |
| 126 | "expected post-restore rows to contain 'alpha', got: {rows:?}" |
| 127 | ); |
| 128 | } |
| 129 | |
| 130 | // ──────────────────────────────────────────────────────────────────── |
| 131 | // Dry run — validates envelope, must not mutate state. |
nothing calls this directly
no test coverage detected