-
Notifications
You must be signed in to change notification settings - Fork 140
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
Respawn if there is nothing to clear at the moment doesn't work #124
Comments
Why are there no tables to clear? That sounds like a bug. |
Well as my colleague explained, we do that in the SetUpFixture of our tests, so we have cases where the database is actually empty (because nothing ran before) and in that case there are no tables to clear. We think that should be a supported scenario, maybe with a flag to avoid people from accidentally not clearing the tables (e.g. |
So why not call Respawn after you set up the database? This sounds like something wonky in your test setup. The reason this was put in was because people were messing up their test setups and not realizing it because Respawn still ran successfully, then wondered why their database still had data even though it ran "successfully". |
I understand the reasoning completely, for 99% of the users the behavior is correct probably. However, would it one of the following two options be acceptable (we would of course be willing to create pull request)?
If you could tell us which option you'd prefer we will submit a pull request implementing it. Thanks in advance! |
Option 3 is to fix the behavior in your tests, what's wrong with that? |
Maybe we don't understand Respawn good enough and there is an easy workaround for this. We basically respawn in each SetUpFixture in our tests. However, sometimes there are no tables to clear and Respawn failed. To overcome this we've used the following workaroud: add an
DbAdapter
that checks inBuildDeleteCommandText
whether the builtcommandText
is empty and in that case throw a specific exception that we can catch and ignore when calling Respawner. Since 6.1.0 this is no longer possible according to one of my team mates.Is there a real way to do this? If not, how to workaround this problem with v6.1.0?
Best regards,
D.R.
The text was updated successfully, but these errors were encountered: