mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-26 22:30:11 +00:00
* feat(rust): embed migration folders with a shared migrate! macro Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(rust): enable syn proc-macro feature for litellm-migrate-macros Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(rust): reject signed versions and symlinks in migrate! 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>
21 lines
764 B
Rust
21 lines
764 B
Rust
use litellm_migrate::Migration;
|
|
use rstest::rstest;
|
|
|
|
const MIGRATIONS: &[Migration] = litellm_migrate::migrate!("tests/fixtures/migrations");
|
|
|
|
#[rstest]
|
|
#[case::first(0, 1, "first", include_str!("fixtures/migrations/1_first.sql"))]
|
|
#[case::second(1, 2, "second", include_str!("fixtures/migrations/2_second.sql"))]
|
|
#[case::tenth(2, 10, "tenth", include_str!("fixtures/migrations/10_tenth.sql"))]
|
|
fn embeds_every_file_sorted_by_numeric_version(
|
|
#[case] index: usize,
|
|
#[case] version: u64,
|
|
#[case] description: &str,
|
|
#[case] sql: &str,
|
|
) {
|
|
assert_eq!(MIGRATIONS.len(), 3);
|
|
let migration = &MIGRATIONS[index];
|
|
assert_eq!(migration.version, version);
|
|
assert_eq!(migration.description, description);
|
|
assert_eq!(migration.sql, sql);
|
|
}
|