()
| 174 | |
| 175 | #[tokio::test(flavor = "multi_thread", worker_threads = 2)] |
| 176 | async fn test_migration_flags() -> Result<()> { |
| 177 | let t = TestContext::new().await; |
| 178 | t.evtracker.get_info_contains("Opened database").await; |
| 179 | |
| 180 | // as migrations::run() was already executed on context creation, |
| 181 | // another call should not result in any action needed. |
| 182 | // this test catches some bugs where dbversion was forgotten to be persisted. |
| 183 | let recode_avatar = migrations::run(&t, &t.sql).await?; |
| 184 | assert!(!recode_avatar); |
| 185 | |
| 186 | info!(&t, "test_migration_flags: XXX END MARKER"); |
| 187 | |
| 188 | loop { |
| 189 | let evt = t |
| 190 | .evtracker |
| 191 | .get_matching(|evt| matches!(evt, EventType::Info(_))) |
| 192 | .await; |
| 193 | match evt { |
| 194 | EventType::Info(msg) => { |
| 195 | assert!( |
| 196 | !msg.contains("[migration]"), |
| 197 | "Migrations were run twice, you probably forgot to update the db version" |
| 198 | ); |
| 199 | if msg.contains("test_migration_flags: XXX END MARKER") { |
| 200 | break; |
| 201 | } |
| 202 | } |
| 203 | _ => unreachable!(), |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | Ok(()) |
| 208 | } |
| 209 | |
| 210 | #[tokio::test(flavor = "multi_thread", worker_threads = 2)] |
| 211 | async fn test_check_passphrase() -> Result<()> { |
nothing calls this directly
no test coverage detected