add a test that catches some cases where dbversion was forgotten to update

This commit is contained in:
B. Petersen
2021-06-11 14:29:58 +02:00
committed by bjoern
parent 1803db2dfe
commit 1870684c43

View File

@@ -802,4 +802,21 @@ mod test {
Ok(())
}
#[async_std::test]
async fn test_migration_flags() -> Result<()> {
let t = TestContext::new().await;
// as migrations::run() was already executed on context creation,
// another call should not result in any action needed.
// this test catches some bugs where dbversion was forgotten to be persisted.
let (recalc_fingerprints, update_icons, disable_server_delete, recode_avatar) =
migrations::run(&t, &t.sql).await?;
assert!(!recalc_fingerprints);
assert!(!update_icons);
assert!(!disable_server_delete);
assert!(!recode_avatar);
Ok(())
}
}