fix(core): resolve deserialization crash and streamline engine DX#4
Merged
fix(core): resolve deserialization crash and streamline engine DX#4
Conversation
… fixtures - Moved snapshot manager initialization to a new `capquery_context` fixture for shared reuse. - Updated `postgres_capquery`, `mysql_capquery`, and `sqlite_capquery` to use the centralized context. - Improved evaluation security by limiting globals for `eval` usage.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ples - Added instructions for creating global fixtures for synchronous and async engines. - Expanded SQL snapshot usage and manual assertion examples with PostgreSQL-specific details.
…ples - Added instructions for creating global fixtures for synchronous and async engines. - Expanded SQL snapshot usage and manual assertion examples with PostgreSQL-specific details.
…in for clarity - Updated all test files to utilize `sqlite_capquery` for better specificity. - Removed the now-unused `capquery` fixture from the plugin.
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.
Description
This release addresses a critical regression in snapshot deserialization introduced in v0.3.0 and significantly improves the Developer Experience (DX) for users configuring custom database engines. It also removes legacy opinionated fixtures to fully align the codebase with the un-opinionated architecture documented in the README.
Key Changes & Fixes
ast.literal_evalwith a robust, controlledeval()block in_deserialize_snapshot.datetime,date,time,timedelta,Decimal,UUID, andfreezegun'sFakeDatetimeduring snapshot assertion, preventingValueErrorcrashes on standard database types.capquery_context): * Extracted the manualSnapshotManagerinitialization logic out of the user'sconftest.py.capquery_contextfixture natively within the plugin, which automatically handles test path resolution,nodeidextraction, and CLI flag (--capquery-update) interception.sqlite_engine-boundcapqueryfixture fromplugin.py. The plugin is now entirely un-opinionated out-of-the-box, enforcing the documented standard that users must explicitly declare their global fixture to bind the wrapper to their specific execution engine.AsyncEngine) engines.Testing
freezegundatetimes (FakeDatetime).capquery_contextinheritance pattern in SQLite, MySQL, and PostgreSQL environments.