citusdata / django-multitenant

Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
707 stars 116 forks source link

Adds additional citus and django versions #197

Closed gurkanindibay closed 9 months ago

gurkanindibay commented 9 months ago

In this PR, we added additional Citus and Django versions into support matrix. Added Citus version: 12 Added Django Version: 4.1, 4.2

With 4.2, in transactions BEGIN and COMMIT statements have been added. Therefore, in query count comparisons, expected query_count should be increased by 2. In the sample test output below, you can see the begin and commit statements https://github.com/citusdata/django-multitenant/actions/runs/6273840069/job/17038085255#step:3:183

E   AssertionError: 9 != 7 : 9 queries executed, 7 expected
E   Captured queries were:
E   1. SELECT "tests_project"."id", "tests_project"."name", "tests_project"."account_id", "tests_project"."employee_id" FROM "tests_project" WHERE "tests_project"."account_id" = 1
E   2. SELECT "tests_task"."id" FROM "tests_task" WHERE ("tests_task"."project_id" IN (124, 125, 126, 127, 128, 129, 130, 131, 132, 133) AND "tests_task"."account_id" = 1)
E   3. BEGIN 
E   4. DELETE FROM "tests_projectmanager" WHERE ("tests_projectmanager"."project_id" IN (124, 125, 126, 127, 128, 129, 130, 131, 132, 133) AND "tests_projectmanager"."account_id" = 1 AND "tests_projectmanager"."account_id" = 1)
E   5. DELETE FROM "tests_subtask" WHERE ("tests_subtask"."project_id" IN (124, 125, 126, 127, 128, 129, 130, 131, 132, 133) AND "tests_subtask"."account_id" = 1 AND "tests_subtask"."account_id" = 1)
E   6. DELETE FROM "tests_aliasedtask" WHERE ("tests_aliasedtask"."project_alias_id" IN (124, 125, 126, 127, 128, 129, 130, 131, 132, 133) AND "tests_aliasedtask"."account_id" = 1 AND "tests_aliasedtask"."account_id" = 1)
E   7. DELETE FROM "tests_revenue" WHERE ("tests_revenue"."project_id" IN (124, 125, 126, 127, 128, 129, 130, 131, 132, 133) AND "tests_revenue"."acc_id" = 1 AND "tests_revenue"."acc_id" = 1)
E   8. DELETE FROM "tests_project" WHERE ("tests_project"."id" IN (133, 132, 131, 130, 129, 128, 127, 126, 125, 124) AND "tests_project"."account_id" = 1)
E   9. COMMIT
codecov[bot] commented 9 months ago

Codecov Report

Merging #197 (31c5ff8) into main (30e3238) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #197   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           44        44           
  Lines         1193      1202    +9     
=========================================
+ Hits          1193      1202    +9     
Files Changed Coverage Δ
django_multitenant/tests/test_models.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more