Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Run all migrations in#[sqlx] tests#5256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Aaron1011 wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromaaron/run-migrations-in-tests

Conversation

@Aaron1011
Copy link
Member

@Aaron1011Aaron1011 commentedDec 17, 2025
edited by ellipsis-devbot
Loading

We now use 'manual_run_postgres_migrations_with_url' at the start of each test, since we have non-trivial dependencies between the migrations in our various crates


Important

Run all migrations in SQLx tests usingmanual_run_postgres_migrations_with_url for consistent database state.

  • Behavior:
    • Usemanual_run_postgres_migrations_with_url at the start of each test inexperimentation_queries.rs andrate_limit_queries.rs to ensure all migrations are run.
    • Removesmigrations attribute from#[sqlx::test] macro inexperimentation_queries.rs andrate_limit_queries.rs.
  • Functions:
    • Addmanual_run_postgres_migrations_with_url inmod.rs to run migrations using a provided URL.
    • Modifymanual_run_postgres_migrations inmod.rs to callmanual_run_postgres_migrations_with_url.
  • Tests:
    • Update test functions inexperimentation_queries.rs andrate_limit_queries.rs to usemanual_run_postgres_migrations_with_url for migration setup.

This description was created byEllipsis for3e1ff7f. You cancustomize this summary. It will automatically update as commits are pushed.

ellipsis-dev[bot] reacted with rocket emoji
We now use 'manual_run_postgres_migrations_with_url' at the startof each test, since we have non-trivial dependencies betweenthe migrations in our various crates
CopilotAI review requested due to automatic review settingsDecember 17, 2025 21:57
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull request overview

This PR updates all#[sqlx::test] tests to manually run PostgreSQL migrations at the start of each test, addressing non-trivial dependencies between migrations across multiple crates.

Key Changes:

  • Extracted a newmanual_run_postgres_migrations_with_url function that accepts a database URL parameter
  • Updated all test functions to acceptPgPoolOptions andPgConnectOptions parameters instead of a pre-configured pool
  • Each test now explicitly runs migrations before creating its connection pool

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

FileDescription
tensorzero-core/src/db/postgres/mod.rsAddedmanual_run_postgres_migrations_with_url function that accepts a URL parameter and refactored the existing function to use it
tensorzero-core/tests/e2e/db/rate_limit_queries.rsUpdated 11 test functions to use the new manual migration pattern with explicit pool creation
tensorzero-core/tests/e2e/db/experimentation_queries.rsUpdated 6 test functions to use the new manual migration pattern with explicit pool creation

virajmehta
virajmehta previously approved these changesDec 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@virajmehtavirajmehtavirajmehta approved these changes

Assignees

@virajmehtavirajmehta

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Aaron1011@virajmehta

[8]ページ先頭

©2009-2025 Movatter.jp