[BD-21] Make use of edx_toggles newest API for testing - #118
Conversation
|
Thanks for the pull request, @regisb! I've created BLENDED-642 to keep track of it in Jira. More details are on the BD-21 project page. When this pull request is ready, tag your edX technical lead. |
89f6426 to
a438a44
Compare
|
This is ready for review @robrap. |
a438a44 to
92e5cc3
Compare
| override (bool): True if tracking should be enabled. | ||
| """ | ||
| _waffle_overrider = waffle.waffle().override(waffle.ENABLE_COMPLETION_TRACKING, override) | ||
| _waffle_overrider = override_waffle_switch(waffle.waffle_switch(waffle.ENABLE_COMPLETION_TRACKING), override) |
There was a problem hiding this comment.
If this is working, can we just leave this as-is until we have the final version of all of this code without namespacing, so we don't have to test and retest this with every revision? We'll just add it once the dust settles.
There was a problem hiding this comment.
This is unfortunately not working, as we remove the .override methods from the waffle namespace classes in edx-platform. edx-platform tests themselves depend on edx-completion's test_utils, so tests will not pass until we merge this.
There was a problem hiding this comment.
- I presume you mean in this PR: https://github.com/edx/edx-platform/pull/25417/files?
- In the edx-platform, I'd rather deprecate and then remove. I usually add something like
set_custom_attribute('deprecated_THING_TO_BE_DEPRECATED', True)to the deprecated methods so I can track that there really is no usage before removal.
We can still land this, but it might be better to land it after, rather than before, so I can see that the deprecated_X custom attribute was firing and finally stops. The main point is to see if anything else is using it that we didn't notice before removal.
There was a problem hiding this comment.
Yes, this is linked to https://github.com/edx/edx-platform/pull/25417.
The override functions are test methods, so my thinking was that it would be overkill to go through the deprecation process for them. But sure, I can do that.
We can still land this, but it might be better to land it after, rather than before, so I can see that the deprecated_X custom attribute was firing and finally stops. The main point is to see if anything else is using it that we didn't notice before removal.
This needs to be merged before https://github.com/edx/edx-platform/pull/25417, or unit tests will fail in edx-platform -- unless we go through a deprecation process.
92e5cc3 to
506925e
Compare
|
@robrap I updated this PR -- and did not squash my changes this time :) |
3db74f1 to
67f276a
Compare
robrap
left a comment
There was a problem hiding this comment.
In terms of timing, assuming we add a custom attribute for monitoring deprecation of the edx-platform WaffleSwitch and WaffleSwitchNamespace before removing them, I'd like to land this after the edx-platform deprecation, and before the removal.
Sounds good. I'll add back the override method to https://github.com/edx/edx-platform/pull/25417 so that we can merge this completion PR after. |
robrap
left a comment
There was a problem hiding this comment.
I plan on delaying merge until I can see the monitoring custom attribute from the edx-platform PR. Please ensure this is squashed as you wish.
| # .. toggle_description: Indicates whether or not to track completion of individual blocks. Keeping this disabled | ||
| # will prevent creation of BlockCompletion objects in the database, as well as preventing completion-related | ||
| # network access by certain xblocks. | ||
| # .. toggle_use_cases: open_edx |
There was a problem hiding this comment.
@regisb: Do you know that this is meant to be a permanent flag, or was this just a guess?
There was a problem hiding this comment.
My bet is that this is meant to be a platform-togglable flag, because I was bit by this in Tutor: https://discuss.overhang.io/t/course-not-starting/962/12 I assumed that the fact that the flag was not enabled by default was a feature, and not a bug. Also, this flag has been there for a very long time, so even if the flag was meant to be temporary, it's now permanent.
There was a problem hiding this comment.
Sounds good. I'm not clear on why it is an option and why it is off by default. I asked the team and we'll see.
Either way, we can merge and it can always be updated later.
67f276a to
0df071a
Compare
Yes, this makes sense. I rebased my changes so this should be ready to merge once you see the deprecation warnings in edx-platform. |
Description: Make use of edx_toggles API for overriding waffle switches in tests
JIRA: https://openedx.atlassian.net/wiki/spaces/COMM/pages/1596358943
Dependencies: openedx/edx-toggles#75 ✔️ merged
Reviewers:
Merge checklist:
deprecated_waffle_utilscustom attribute data exists before landing thisPost merge:
finished.