-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dropAll() return immediately if no tables found #193
dropAll() return immediately if no tables found #193
Conversation
Please add a test that runs this code. |
Im actually not sure how to test this? Since dropAll() returns void, how would I test if it exited early due to there being no tables, or if it exited later because it found and dropped some tables? |
I'm ok as long as all the code paths are covered. |
added test_dropAllTablesEmpty(), that should cover it? |
It appears to work when I run it, but I am not sure about a couple of things Does that test_dropAllTablesEmpty() get run last in the file? If so it will be okay since the previous test_dropAllTables() will have emptied the db. Or do the test methods in the file get called in any order, in which case does each test method start with an empty database, or do artefacts from previous tests persist? |
I think tests that depend on other tests to be run first is really bad. So ideally, there should be a hook which deletes all created tables after every test, but that slows down the entire test significantly. As a compromise, I think you should drop all tables twice in this test. Once to actually clear all tables, and 2nd run which will guarantee that the given code is run. |
Done |
Please add a changelog |
Do you want me to do anything or you got it? |
I'd appreciate it if you can write the ones for the previous two. Thanks. |
Which branch should I do it on? |
master for all unreleased features. |
Small tweak to Schema Builder dropAll() - if no tables exists simply return immediately