mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
* feat(rust): add litellm-db and litellm-db-testing workspace scaffolding Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(db-testing): apply the real Prisma migrations in a test and drop the sort mutation Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Yujong Lee <yujong@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
24 lines
715 B
Rust
24 lines
715 B
Rust
use std::path::Path;
|
|
|
|
use litellm_db_testing::{MigratedPostgres, PRISMA_MIGRATIONS_DIR, prisma_migrations};
|
|
use rstest::rstest;
|
|
|
|
#[rstest]
|
|
#[tokio::test]
|
|
async fn real_prisma_migrations_apply_to_a_fresh_postgres() {
|
|
let postgres = MigratedPostgres::start().await.unwrap();
|
|
|
|
#[expect(
|
|
clippy::disallowed_methods,
|
|
reason = "the test schema has no offline query data"
|
|
)]
|
|
let applied: i64 = sqlx::query_scalar("SELECT count(*) FROM _sqlx_migrations WHERE success")
|
|
.fetch_one(postgres.pool())
|
|
.await
|
|
.unwrap();
|
|
|
|
let expected = prisma_migrations(Path::new(PRISMA_MIGRATIONS_DIR))
|
|
.unwrap()
|
|
.len();
|
|
assert_eq!(applied as usize, expected);
|
|
}
|