artifactize-core 0.27.0

The library behind artifactize: Artifacts, evals, reviews, the monitor and review models, and the shared operations every interface calls.
Documentation
use super::*;

#[tokio::test]
async fn run_snapshot_does_not_upgrade_an_older_store() {
    let state = crate::test_os::tempdir();
    let database = state.path().join(DATABASE);
    rusqlite::Connection::open(&database)
        .unwrap()
        .execute_batch("CREATE TABLE runs(status TEXT, data TEXT); PRAGMA user_version = 9;")
        .unwrap();

    assert!(read_run_snapshot(state.path(), "missing").await.is_err());

    let db = rusqlite::Connection::open_with_flags(
        &database,
        rusqlite::OpenFlags::SQLITE_OPEN_READ_ONLY,
    )
    .unwrap();
    let version = db
        .pragma_query_value(None, "user_version", |row| row.get::<_, u32>(0))
        .unwrap();
    assert_eq!(version, 9, "observing a Run never upgrades the database");
}