Refactor env, ci, and goose-migrate to accomodate testing. Also add simple tests for up and down command
What does this MR do and why?
Refactored env, ci, and goose-migrate to accomodate testing:
- Added tests for
upanddowncommands. - Added tests for persistent flags.
- Replaced inits and global variables with the factory pattern to allow instantiation of the migrate command in tests. This allows us to create new fresh states of commands and tests the actual command being run by CLI.
- Added fixtures that adds dummy tables just for testing.
- Added feature to skip migrations.
References
This MR closes this issue
How to set up and validate locally
- Run
env SKIP_MIGRATIONS=true ./env.sh postgres make test-goose-migrateand verify that all tests passes. - Run
env SKIP_MIGRATIONS=true ./env.sh spanner make test-goose-migrateand verify that all tests passes.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Tarun Khandelwal