-
Notifications
You must be signed in to change notification settings - Fork 72
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
Remove test_mode #1288
Remove test_mode #1288
Conversation
migrations aren't working now, getting an error around test mode even though it doesn't get mentioned anywhere, will keep investigating |
I found the culprit in |
@pattisdr curious what your ideas are for a problem I'm hitting here technically: In The only thing that I can think of would be to start another instance of the webserver that is pointing at the test database? |
@seanpreston do you know what we did in Fidesops for this? I guess I don't really understand how we fundamentally ran tests over there. |
When I looked through it, it looks like ops is getting a database session directly, instead of going through the API for most cases In the cases where it is using the |
Ah OK, tracing it through
|
Thanks for tracing it! Ah I see, so the application itself was aware of test mode... I guess we have a few options here then:
Do you see any other potential solutions here? Are you leaning towards any in particular? I don't see any way to really satisfy the original ticket, since it seems like we get to either drop test mode or have separate application and test databases, but maybe I'm not thinking of a clever enough solution |
My main motivation was having a separate application and test database! Getting rid of test mode I thought was just a means to that end, to help unify the ctl and ops pieces, but that doesn't seem to be true. The current setup is making it difficult to develop ops-related code. When I'm switching between writing tests and running things locally, I keep finding the database getting wiped because they're sharing the same location. I think this is a deterrent to running the app locally when we should be doing this more not less. So when you lay out those options, I have a strong preference for |
This is the reason we had the tests hit a separate DB to the running application's — if you want to run tests and develop at the same time it's often good for productivity so we should support it.
@ThomasLaPiana — I'd be interested to see if there's a way we can dynamically change the DB connection URL based on a config var? At it's heart that's all the ops solution does. |
Where there's a will there's a way! But I'd have to spend some time thinking about it, and probably look more at the ops solution to get some ideas. I just don't have the bandwidth for this right now, but I agree it's something we should do in the near-term to keep everyone productive. I also welcome anyone who wants to/has ideas to take a pass at it |
i'm going to update the issue this is related to and then close this PR, since the strategy will be totally different |
Closes #1175
Code Changes
removetest_mode
and various assertions from everywherepytest
to bring up and tear down a test database entirely for each run using the test database config valuesSteps to Confirm
Pre-Merge Checklist
CHANGELOG.md
Description Of Changes
Having an explicit test mode added complexity and didn't feel like a great solution. Instead, this PR relies on
dev_mode
where needed to replacetest_mode
and makes the much larger change of updatingpytest
to bring up and tear down its own separate database.