Skip to content

Really ugly work in progress hack to fix tests on Django@master #1427

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 3 commits into from

Conversation

matthiask
Copy link
Member

@matthiask matthiask commented Dec 22, 2020

Django 3.2 has changed a few internals in the django.core.cache module. Our instrumentation doesn't pick up cache calls anymore. Here's a hack which has worked locally. Since django-debug-toolbar relies on monkey patching anyway, something like this may work.

(Test failures on released Django versions are to be expected.)

@tim-schilling
Copy link
Member

I think in order to commit this, we'd need to figure out a way to have the cache tracking disabled.

@tim-schilling
Copy link
Member

This will enable the cache panel for the middleware by default. I don't think it's possible to avoid that and still capture the middleware cache calls before the toolbar's middleware.

@codecov
Copy link

codecov bot commented Jan 2, 2021

Codecov Report

Merging #1427 (78bcb93) into master (e5835ec) will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1427      +/-   ##
==========================================
+ Coverage   87.44%   87.60%   +0.15%     
==========================================
  Files          29       29              
  Lines        1577     1581       +4     
  Branches      220      220              
==========================================
+ Hits         1379     1385       +6     
+ Misses        146      145       -1     
+ Partials       52       51       -1     
Impacted Files Coverage Δ
debug_toolbar/panels/cache.py 84.05% <100.00%> (+0.47%) ⬆️
debug_toolbar/panels/sql/views.py 90.62% <0.00%> (+3.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5835ec...78bcb93. Read the comment docs.

@tim-schilling
Copy link
Member

With #1437 merged, this can be closed.

@matthiask matthiask deleted the mk/djmaster-cache-panel branch January 24, 2021 16:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants