From 5d9d20e029c43fcb8699e336bca39912842d494d Mon Sep 17 00:00:00 2001 From: Robert Raposa Date: Wed, 14 Mar 2018 10:10:17 -0400 Subject: [PATCH 1/3] Add docs for handling default values. --- .../core/djangoapps/waffle_utils/__init__.py | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/waffle_utils/__init__.py b/openedx/core/djangoapps/waffle_utils/__init__.py index e317436104..dbd446a25c 100644 --- a/openedx/core/djangoapps/waffle_utils/__init__.py +++ b/openedx/core/djangoapps/waffle_utils/__init__.py @@ -44,6 +44,21 @@ To test WaffleSwitchNamespace, use the provided context managers. For example: with WAFFLE_SWITCHES.override(waffle.ESTIMATE_FIRST_ATTEMPTED, active=True): ... +For long-lived flags, you may want to change the default for the flag from "off" +to "on", so that it is "on" by default in devstack, sandboxes, or new Open edX +releases, more closely matching what is in Production. This is for flags that +can't yet be deleted, for example if there are straggling course overrides. + + * WaffleFlag has a DEPRECATED argument flag_undefined_default that we don't + recommend you use any more. Although this can work, it is proven not ideal to + have a value that isn't immediately obvious via Django admin. + + * At this time, the proper alternative has not been fully designed. The + following food-for-thought could provide ideas for this design when needed: + using migrations, using app-level configuration, using management commands, + and/or creating records up front so all toggle defaults are explicit rather + than implicit. + """ import crum import logging @@ -230,8 +245,9 @@ class WaffleFlagNamespace(WaffleNamespace): check_before_waffle_callback(namespaced_flag_name) returns True or False, it is returned. If it returns None, then waffle is used. - flag_undefined_default (Boolean): A default value to be returned if - the waffle flag is to be checked, but doesn't exist. + DEPRECATED flag_undefined_default (Boolean): A default value to be + returned if the waffle flag is to be checked, but doesn't exist. + See docs for alternatives. """ # Import is placed here to avoid model import at project startup. from waffle.models import Flag From c7268f2293d25e0d297497da1669d3a4d5f54aa7 Mon Sep 17 00:00:00 2001 From: Robert Raposa Date: Thu, 15 Mar 2018 09:56:17 -0400 Subject: [PATCH 2/3] Remove flaky test and commented-out tests. Presumably the commented-out tests were also flaky at one point, and the current process is to remove flaky tests. EDUCATOR-2512 --- lms/djangoapps/courseware/features/problems.feature | 3 --- 1 file changed, 3 deletions(-) diff --git a/lms/djangoapps/courseware/features/problems.feature b/lms/djangoapps/courseware/features/problems.feature index a35951b9e0..b2807056b8 100644 --- a/lms/djangoapps/courseware/features/problems.feature +++ b/lms/djangoapps/courseware/features/problems.feature @@ -21,9 +21,6 @@ Feature: LMS.Answer problems | checkbox | incorrect | always | | radio | correct | always | | radio | incorrect | always | - #| string | correct | always | - #| string | incorrect | always | - | numerical | correct | always | | numerical | incorrect | always | | formula | correct | always | | formula | incorrect | always | From a814c8d44c48844225ee66bff4c6cad1e56ba39d Mon Sep 17 00:00:00 2001 From: Robert Raposa Date: Thu, 15 Mar 2018 11:46:55 -0400 Subject: [PATCH 3/3] Removing flaky test test_can_add_remove_allowance. EDUCATOR-2514 --- .../lms/test_lms_instructor_dashboard.py | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py index fec37fe269..eb2754082d 100644 --- a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py +++ b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py @@ -397,35 +397,6 @@ class ProctoredExamsTest(BaseInstructorDashboardTest): self.courseware_page.stop_timed_exam() LogoutPage(self.browser).visit() - def test_can_add_remove_allowance(self): - """ - Make sure that allowances can be added and removed. - """ - # Given that an exam has been configured to be a timed exam. - self._create_a_timed_exam_and_attempt() - - # When I log in as an instructor, - __, __ = self.log_in_as_instructor() - - # And visit the Allowance Section of Instructor Dashboard's Special Exams tab - instructor_dashboard_page = self.visit_instructor_dashboard() - allowance_section = instructor_dashboard_page.select_special_exams().select_allowance_section() - - # Then I can add Allowance to that exam for a student - self.assertTrue(allowance_section.is_add_allowance_button_visible) - - # When I click the Add Allowance button - allowance_section.click_add_allowance_button() - - # Then popup should be visible - self.assertTrue(allowance_section.is_add_allowance_popup_visible) - - # When I fill and submit the allowance form - allowance_section.submit_allowance_form('10', self.USERNAME) - - # Then, the added record should be visible - self.assertTrue(allowance_section.is_allowance_record_visible) - def test_can_reset_attempts(self): """ Make sure that Exam attempts are visible and can be reset.