feat!: v1.5.0 — remove fixer, fix coverage measurement, fix VARCHAR seed bug, 90% coverage#91
Merged
Merged
Conversation
…oral tests
Coverage: switch CI main test step from `pytest --cov` to `coverage run -m pytest`
so pytest_mrt plugin files are measured before coverage starts — closes the
module-not-measured gap that was incorrectly reporting config.py/exceptions.py/
__init__.py at 0% and suppressing ~9 points from the total. Overall: 80% → 90%.
seeder.py: fix VARCHAR suffix truncation (Bug 2) — for short VARCHAR(N) columns,
the unique-suffix appended to seed values was silently truncated because the
previous code did `(val + f"_{i}")[:255]` with a hardcoded 255 limit. Now parses
the actual column limit from type_str and trims the base value to make room,
so the suffix always survives and UNIQUE constraints are reliably satisfied.
Tests added:
- test_verifier_unit.py: timeout path, error recovery, chain-advance failure,
risk_score capping, failure_summary format, skip logic (RollbackVerifier)
- test_seeder.py: VARCHAR(5), VARCHAR(3), and INT unique-suffix paths
- test_plugin.py: mode-guard RuntimeErrors (check_revision/check_migration/
assert_reversible in wrong mode), _auto_detect_django ImportError branch,
check_static with parse-error migration, metadata_path override,
MRTConfigError exception type, pytest_sessionstart early-exit
ThreadPoolExecutor.__exit__ calls shutdown(wait=True), so the timeout test
was blocking for the full sleep duration (10s) even after FuturesTimeout fired.
Reduced to sleep=0.5s / timeout=0.05s — test now completes in ~0.6s.
seeder: when the VARCHAR column limit is shorter than the suffix itself
(e.g. VARCHAR(1) with suffix "_0"), fall back to a fresh uuid.uuid4().hex[:limit]
instead of truncating the suffix — prevents producing the same value ("_") for
every row, which caused silent UNIQUE violations on that edge case.
6289130 to
7e32d38
Compare
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mrt fix,mrt clean-backups,core/fixer.py,adapters/django_fixer.py) — fixer transforms migrations rather than verifying them; out of scope for a rollback-safety tool. Breaking change → v1.5.0.pytest --covwhich importspytest_mrtas a plugin before coverage starts, leavingconfig.py,exceptions.py,__init__.pyat 0%. Switching tocoverage run -m pytestbrings overall coverage from 80% → 90%.seed_table()was doing(val + f"_{i}")[:255]with a hardcoded 255 limit. ForVARCHAR(5)columns the suffix was silently dropped, causing UNIQUE violations. Now parses the actual column limit fromtype_strand trims the base value to make room.test_verifier_unit.py(timeout, error recovery, chain-advance failure); expandedtest_plugin.pyandtest_seeder.pywith genuine gap coverage (mode guards, env fallbacks, parse-error handling, short-varchar uniqueness).Breaking changes
mrt fixandmrt clean-backupsCLI commands removed. Projects using these must remove them from their workflow. The verify/check/seed functionality is unchanged.Test plan
pytest_mrt/core/seeder.pyVARCHAR short-column tests pass (no UNIQUE violations)test_verifier_unit.py— timeout, recovery, chain-advance paths covered