Skip to content

Commit

Permalink
Re-write a test that depends on the line numbers of a source file (sq…
Browse files Browse the repository at this point in the history
…lite)
  • Loading branch information
miguelff committed Nov 23, 2023
1 parent e4db9cc commit 1b907b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libs/test-setup/src/test_api_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl TestApiArgs {
}

pub fn max_ddl_refresh_delay(&self) -> Option<Duration> {
self.db.max_ddl_refresh_delay.clone()
self.db.max_ddl_refresh_delay
}
}

Expand Down
10 changes: 3 additions & 7 deletions schema-engine/sql-migration-tests/tests/migrations/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,9 @@ fn unique_constraint_errors_in_migrations(api: TestApi) {
.send_unwrap_err()
.to_user_facing();

let expected_json = expect![[r#"
{
"is_panic": false,
"message": "SQLite database error\nUNIQUE constraint failed: Fruit.name\n 0: sql_schema_connector::apply_migration::apply_migration\n at schema-engine/connectors/sql-schema-connector/src/apply_migration.rs:10\n 1: sql_migration_tests::commands::schema_push::SchemaPush\n with \u001b[3mmigration_id\u001b[0m\u001b[2m=\u001b[0mSome(\"the-migration\")\n at schema-engine/sql-migration-tests/src/commands/schema_push.rs:43",
"backtrace": null
}"#]];
expected_json.assert_eq(&serde_json::to_string_pretty(&res).unwrap())
assert!(serde_json::to_string_pretty(&res)
.unwrap()
.contains("UNIQUE constraint failed: Fruit.name"));
}

#[test]
Expand Down

0 comments on commit 1b907b3

Please sign in to comment.