Skip to content
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

[Unified Fides] Populate Application DB instead of Test DB #1175

Closed
pattisdr opened this issue Oct 3, 2022 · 5 comments · Fixed by #1731
Closed

[Unified Fides] Populate Application DB instead of Test DB #1175

pattisdr opened this issue Oct 3, 2022 · 5 comments · Fixed by #1731

Comments

@pattisdr
Copy link
Contributor

pattisdr commented Oct 3, 2022

Is your feature request related to a specific problem?

Currently, Fides has a "Test mode" setting which populates the test db when True, and the application db when False. Test mode seems to be True by default. So when running the application locally, it is the test db that is getting populated.

Fidesops had "test mode" as False by default. It was not meant to be set as True by anyone, it was just a variable that Pytest set to True to have the Test DB be used.

For the Fidesops side of things, it is useful to have a separate database from the test database when you're testing privacy requests locally, and depending on some resources to persist there without being created and torn down by the testing harness.

Describe the solution you'd like

  • Populate the normal application database during regular development
  • Have Pytest set up and tear down the test database for its own testing
  • Get rid of the "Test Mode" variable, the application doesn't need to set this. Pytest itself should just use the test db.

EDIT ON October 20, 2022 by @ThomasLaPiana:

After more discussion in the initial PR that is now closed, it was determined that the right way to go forward is the following:

  • Remove test mode
  • Update ctl database access methods to support injecting/swapping database connections after startup
  • Verify that both ops and ctl use the test url when running pytest, and test runs leave the application db untouched
@pattisdr
Copy link
Contributor Author

pattisdr commented Oct 3, 2022

See #1162 for more discussion

@pattisdr pattisdr changed the title [Unified Fides] Populate Application DB versus Test DB [Unified Fides] Populate Application DB instead of Test DB Oct 3, 2022
@seanpreston
Copy link
Contributor

I think an acceptable solution for this in the near-term could also be to rename the usages of Fidesops' definition of test_mode, since it doesn't need to be set by a user at all.

@ThomasLaPiana ThomasLaPiana mentioned this issue Oct 8, 2022
9 tasks
@pattisdr
Copy link
Contributor Author

pattisdr commented Nov 7, 2022

Looking into how to change the DB connection URL based on a config var in ctl code, we should already be able to change ops code to do this since this was fidesops worked initially.

@seanpreston
Copy link
Contributor

@pattisdr has suggested we hold off on merging this until after the Fidesplus 2.0 launch, great idea thanks!

@pattisdr
Copy link
Contributor Author

pattisdr commented Dec 9, 2022

Temporarily moving to blocked until unified fides work is done. I have one failing end-to-end test on Fides Connectors after getting this up-to-date with main. It's a tricky one to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants