Skip to content

Conversation

@ivanauth
Copy link
Contributor

Description

Fixes #2758 by refactoring migrate execution for testability and adding coverage.

Changes

  • Extract MigrateConfig
  • Add executeMigrate helper
  • Add migrate tests

@ivanauth ivanauth requested a review from a team as a code owner January 15, 2026 14:16
@github-actions github-actions bot added area/cli Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Jan 15, 2026
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.44%. Comparing base (0b5d8c5) to head (3908502).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cmd/migrate.go 62.50% 14 Missing and 1 partial ⚠️

❌ Your project check has failed because the head coverage (74.44%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2822      +/-   ##
==========================================
- Coverage   78.46%   74.44%   -4.01%     
==========================================
  Files         459      484      +25     
  Lines       44674    57303   +12629     
==========================================
+ Hits        35048    42656    +7608     
- Misses       6769    11657    +4888     
- Partials     2857     2990     +133     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add test cases for all error paths in executeMigrate:
- CockroachDB driver creation failure (invalid URI)
- Postgres invalid credentials provider
- Postgres driver creation failure (invalid URI)
- Spanner driver creation failure (cancelled context)
- MySQL invalid credentials provider
- MySQL driver creation failure (invalid DSN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: write tests for "migrateRun"

1 participant