Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

715 B
Raw Blame
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);
}