Add test case for partial verification with toChange parameter (test-case/verify) #152
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.
Add test case for partial verification with toChange parameter
Summary
This PR implements and tests the
toChangeparameter functionality for module verification, allowing verification to stop at a specific point in the migration plan rather than verifying the entire module. The implementation includes:toChangeparameter support inLaunchQLMigrate.verify()method to filter changes up to specified pointLaunchQLProject.verify()to only applytoChangeto the target module being verified, not its dependenciesverify-partial.test.tsthat demonstrates partial verification by breaking a verify script and showing thattoChangelimits verification scopetoChangesemantics than deploy/revert operationsKey insight: Verification must check ALL dependencies for system integrity, while deploy/revert operations can safely apply
toChangeto all modules because they maintain consistency through ordered execution.Review & Testing Checklist for Human
toChange: extension === name ? toChange : undefinedpattern inLaunchQLProject.verify()- ensure this only applies to the target module and not dependencieslaunchql verify my-third --to-change=create_schema(should succeed) followed bylaunchql verify my-third(should fail)toChangebehavior for verification vs deploy/revert makes operational sense and is properly documentedfs.writeFileSyncapproach properly cleans up and doesn't cause issues in CI environmentsRecommended test plan: Deploy the
my-thirdmodule from fixtures, manually editcreate_table.sqlverify script to break it, then run partial verification to confirm it stops at the specified point while full verification fails appropriately.Diagram
%%{ init : { "theme" : "default" }}%% graph TD CoreTestFixture["packages/core/test-utils/<br/>CoreDeployTestFixture.ts"]:::context LaunchQLProject["packages/core/src/core/class/<br/>launchql.ts"]:::major-edit LaunchQLMigrate["packages/core/src/migrate/<br/>client.ts"]:::major-edit VerifyPartialTest["packages/core/__tests__/projects/<br/>verify-partial.test.ts"]:::minor-edit VerifyScript["__fixtures__/sqitch/simple-w-tags/<br/>packages/my-third/verify/create_table.sql"]:::context CoreTestFixture -->|"calls verifyModule()"| LaunchQLProject LaunchQLProject -->|"conditional toChange logic<br/>extension === name"| LaunchQLMigrate LaunchQLMigrate -->|"filters changes<br/>up to toChange"| LaunchQLMigrate VerifyPartialTest -->|"modifies verify script<br/>to test failure scenarios"| VerifyScript VerifyPartialTest -->|"calls fixture.verifyModule()<br/>with toChange param"| CoreTestFixture subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
toChangelogic is the highest risk area - it determines when partial verification applies and could easily break if the logic is incorrecttoChangeto all modules because they are idempotent and maintain consistency, unlike verification which must check all dependenciesfindIndexand slice operations in the filtering logic need validation for edge cases like missing changes