test(sqldef): add unit tests for rollback stage, utils, and provider - #52
Open
vanshika2720 wants to merge 2 commits into
Open
test(sqldef): add unit tests for rollback stage, utils, and provider#52vanshika2720 wants to merge 2 commits into
vanshika2720 wants to merge 2 commits into
Conversation
Cover executeRollbackStage, findFirstSQLFile edge cases, the SqldefProviderImpl exec wrapper, and Plugin dispatch/versioning methods that previously had no test coverage. Signed-off-by: Vanshika <pahalvanshikaa@gmail.com>
ExecuteStage's panic on an unrecognized stage name is unsafe behavior that is being replaced with an error return in a separate fix. Encoding the panic as expected here would make this coverage-only PR conflict with that fix once merged, so leave the regression test for the fix that changes the behavior. Signed-off-by: Vanshika <pahalvanshikaa@gmail.com>
Author
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.
What this PR does
Adds unit tests for previously uncovered SQLDef plugin logic, including
executeRollbackStage,findFirstSQLFileedge cases,SqldefProviderImpl, and plugin dispatch, versioning, and strategy methods.Adds deterministic tests using temporary directories and a fake
sqldefexecutable, without requiring a network connection or real database.Improves
plugins/sqldefcoverage from 48.2% to 96.4%, withdeploymentandproviderreaching 100% coverage.Why we need it / Without this PR, what is the problem?
Several important SQLDef plugin paths had little or no test coverage, making regressions harder to detect.
These tests cover success and failure paths, edge cases, stage dispatch, and provider behavior while keeping the tests isolated from external services. No production code was changed.