Add tests for masoniteorm schema platforms + query processors/grammars#161
Conversation
…grammars Cover SQL generation for MySQL, MSSQL and Postgres schema platforms (create/alter compilation, drop/truncate/rename helpers, foreign keys, constraints and indexes) plus the MSSQL query grammar and all four insert-id post processors. Tests mock connections so no live database is required. Coverage: platforms 18-24% -> 76-87%, post processors -> 100%, MSSQLGrammar 52% -> 74%.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Request changes — CI is red (Ruff format check fails). Everything else is solid; this is a one-command fix. Blocker (1): Ruff format fails on 3 files — CI Lint job is FAILURE
Everything else verified and good — no other changes required:
Re-request review once |
Formatting-only change to satisfy the Ruff format CI check — wraps over-length list literals and normalizes quotes. No test logic changed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ APPROVE (self-approval via GitHub UI is blocked on own PR, so recording verdict here). Prior blocker resolved: pushed Final CI on
Full review recap (all verified good):
Ready to merge at the PM's discretion. I am not merging (standing no-merge order). |
89b957c to
c02ccae
Compare
c02ccae to
82a93b7
Compare
Summary
Raises coverage for the previously thin
masoniteormschema platforms and query processors/grammars (task #720). All tests mock connections and generate SQL as pure strings — no live database required.What's covered
schema/platforms/): MySQL, MSSQL and Postgres —compile_create_sql(defaults, enums, foreign keys, indexes),compile_alter_sql(add/drop/rename/change columns, foreign keys, constraints, indexes, table comments), and the drop / truncate / rename / exists / foreign-key-toggle helpers.query/processors/):process_insert_get_idandget_column_valuefor SQLite, MySQL, Postgres and MSSQL, including the Postgreslastvalfallback and MSSQL identity casting.query/grammars/MSSQLGrammar.py): SELECT/WHERE/IN/BETWEEN/LIKE,TOP/OFFSET FETCHpaging, ordering, grouping, joins, insert and delete, plus grammar primitives (NEWID(), bracket quoting, truncate).Coverage impact
Full suite: 1731 passed, total coverage 74.5% (threshold 68%). Remaining uncovered lines are the async live-DB schema-introspection paths (
get_current_schema), which need a real connection.Per scope,
masoniteorm.backupis ignored.