Skip to content

test: add mock-based orchestration tests#20

Merged
bitalizer merged 1 commit into
masterfrom
test/mock-orchestration-tests
Apr 12, 2026
Merged

test: add mock-based orchestration tests#20
bitalizer merged 1 commit into
masterfrom
test/mock-orchestration-tests

Conversation

@bitalizer
Copy link
Copy Markdown
Owner

Summary

  • Add 17 mock-based tests for DatabaseMigrator and TableMigrator using mock Extractor/Inserter trait implementations
  • Validates orchestration logic (table filtering, whitelist, batching, fail-fast, constraints, snake_case) without real database connections
  • Builds on the trait abstractions from PR refactor: trait abstractions for testable DB layer #19

Tests added

DatabaseMigrator (11 tests):

  • Single/multiple table migration
  • Whitelist filtering and missing whitelist match
  • No tables error
  • Packet size validation
  • Fail-fast on table error with cancellation
  • Table already has rows rejection
  • Existing empty table reuse
  • Snake case formatting
  • Constraints creation flow

TableMigrator (6 tests):

  • Empty table, single batch, multiple batches
  • Schema fetch error, mapping not found error
  • Table creation failure

Test plan

  • All 130 tests pass (113 existing + 17 new)
  • cargo clippy -- -D warnings clean
  • cargo fmt --check clean

Add 17 tests using mock Extractor/Inserter implementations to verify
migration orchestration logic without requiring real database connections.
@bitalizer bitalizer force-pushed the test/mock-orchestration-tests branch from 9ec71b8 to 540f891 Compare April 12, 2026 14:40
@bitalizer bitalizer merged commit 481b26d into master Apr 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant