You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ops tests can't rely on resources that are automatically added to the database by the application on startup because the database is intentionally wiped before the tests run.
We have a handy clear_db_tables "autouse" fixture that wipes the database in between tests to prevent any resources created by tests from sticking around. However, now that ops and ctl code have merged, there are several additional resources that are automatically added to the db on startup in load_default_resources: load_default_organization, load_default_taxonomy, and load_default_dsr_policies.
I was adjusting data category validation on the ops-side to compare against data categories in the database instead of the static default taxonomy list. But in tests, there are no data categories in the database ops-side.
Steps to Reproduce
Bring the shell up. Verify ctl_data_categories table is populated
Run a test in pytest - verify the ctl_data_categories table gets wiped.
Expected behavior
It would be useful if these resources were not removed - or if they were, then we re-ran load_default_resources. Removing this fixture altogether does cause several tests to fail where we're not cleaning up resources in tests.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Version:
OS:
Python Version:
Docker Version:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
pattisdr
changed the title
Ops-side Tests Clear DB Tables Removes Resources Loaded by Default
Ops-side Tests Clear DB Tables: Removes Resources Loaded by Default
Dec 9, 2022
Bug Description
Ops tests can't rely on resources that are automatically added to the database by the application on startup because the database is intentionally wiped before the tests run.
We have a handy
clear_db_tables
"autouse" fixture that wipes the database in between tests to prevent any resources created by tests from sticking around. However, now that ops and ctl code have merged, there are several additional resources that are automatically added to the db on startup inload_default_resources
:load_default_organization
,load_default_taxonomy
, andload_default_dsr_policies
.This came up here: https://github.com/ethyca/fides/pull/2009/files#r1044804685
I was adjusting data category validation on the ops-side to compare against data categories in the database instead of the static default taxonomy list. But in tests, there are no data categories in the database ops-side.
Steps to Reproduce
Expected behavior
It would be useful if these resources were not removed - or if they were, then we re-ran
load_default_resources
. Removing this fixture altogether does cause several tests to fail where we're not cleaning up resources in tests.Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: