From cd580ac24708703c94b4217cfcebc1bee017ff4d Mon Sep 17 00:00:00 2001 From: Christine Lytwynec Date: Wed, 9 Jul 2014 16:59:46 -0400 Subject: [PATCH 1/2] overriding a few more log levels for acceptance tests --- cms/envs/acceptance.py | 20 ++++++++++++-------- lms/envs/acceptance.py | 15 +++++++++++---- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index 6c973182c2..1dac650f2d 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -24,15 +24,19 @@ import os def seed(): return os.getppid() -# Suppress error message "Cannot determine primary key of logged in user" -# from track.middleware that gets triggered when using an auto_auth workflow -# This is an ERROR level warning so we need to set the threshold at CRITICAL -logging.getLogger('track.middleware').setLevel(logging.CRITICAL) +# Silence noisy logs +LOG_OVERRIDES = [ + ('track.middleware', logging.CRITICAL), + ('codejail.safe_exec', logging.ERROR), + ('edx.courseware', logging.ERROR), + ('edxmako.shortcuts', logging.ERROR), + ('audit', logging.ERROR), + ('contentstore.views.import_export', logging.CRITICAL), + ('xmodule.x_module', logging.CRITICAL), +] -# Suppress warning message "Cannot find corresponding link for name: " -# from edxmako.shortcuts. We have no appropriate pages in the platform to -# use, so these are not set up for TOS and PRIVACY -logging.getLogger('edxmako.shortcuts').setLevel(logging.ERROR) +for log_name, log_level in LOG_OVERRIDES: + logging.getLogger(log_name).setLevel(log_level) update_module_store_settings( MODULESTORE, diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index c2431d2704..ba2661074c 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -27,10 +27,17 @@ import string def seed(): return os.getppid() -# Suppress error message "Cannot determine primary key of logged in user" -# from track.middleware that gets triggered when using an auto_auth workflow -# This is an ERROR level warning so we need to set the threshold at CRITICAL -logging.getLogger('track.middleware').setLevel(logging.CRITICAL) +# Silence noisy logs +LOG_OVERRIDES = [ + ('track.middleware', logging.CRITICAL), + ('codejail.safe_exec', logging.ERROR), + ('edx.courseware', logging.ERROR), + ('audit', logging.ERROR), + ('instructor_task.api_helper', logging.ERROR), +] + +for log_name, log_level in LOG_OVERRIDES: + logging.getLogger(log_name).setLevel(log_level) update_module_store_settings( MODULESTORE, From 0581d0c5a184099e4c63d52092952b1b727abecb Mon Sep 17 00:00:00 2001 From: Christine Lytwynec Date: Fri, 11 Jul 2014 10:19:06 -0400 Subject: [PATCH 2/2] disabling zendesk in lettuce tests and removing help/feedback lettuce tests in favor of the existing JS ones --- .../courseware/features/help.feature | 32 ------------- lms/djangoapps/courseware/features/help.py | 45 ------------------- lms/envs/acceptance.py | 3 +- 3 files changed, 1 insertion(+), 79 deletions(-) delete mode 100644 lms/djangoapps/courseware/features/help.feature delete mode 100644 lms/djangoapps/courseware/features/help.py diff --git a/lms/djangoapps/courseware/features/help.feature b/lms/djangoapps/courseware/features/help.feature deleted file mode 100644 index db8c49900a..0000000000 --- a/lms/djangoapps/courseware/features/help.feature +++ /dev/null @@ -1,32 +0,0 @@ -@shard_2 -Feature: LMS.The help module should work - In order to get help - As a student - I want to be able to report a problem - - - Scenario: I can submit a problem when I am not logged in - Given I visit the homepage - When I open the help form - And I report a "" - Then I should see confirmation that the issue was received - - Examples: - | FeedbackType | - | problem | - | suggestion | - | question | - - - Scenario: I can submit a problem when I am logged in - Given I am in a course - When I open the help form - And I report a "" without saying who I am - Then I should see confirmation that the issue was received - - Examples: - | FeedbackType | - | problem | - | suggestion | - | question | - diff --git a/lms/djangoapps/courseware/features/help.py b/lms/djangoapps/courseware/features/help.py deleted file mode 100644 index 1b79a7e725..0000000000 --- a/lms/djangoapps/courseware/features/help.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 - -from lettuce import world, step - - -@step(u'I open the help form') -def open_help_modal(step): - help_css = 'div.help-tab' - world.css_click(help_css) - - -@step(u'I report a "([^"]*)"$') -def submit_problem_type(step, submission_type): - type_css = '#feedback_link_{}'.format(submission_type) - world.css_click(type_css) - fill_field('name', 'Robot') - fill_field('email', 'robot@edx.org') - fill_field('subject', 'Test Issue') - fill_field('details', 'I am having a problem') - submit_css = 'div.submit' - world.css_click(submit_css) - - -@step(u'I report a "([^"]*)" without saying who I am$') -def submit_partial_problem_type(step, submission_type): - type_css = '#feedback_link_{}'.format(submission_type) - world.css_click(type_css) - fill_field('subject', 'Test Issue') - fill_field('details', 'I am having a problem') - submit_css = 'div.submit' - world.css_click(submit_css) - - -@step(u'I should see confirmation that the issue was received') -def see_confirmation(step): - assert world.browser.evaluate_script("$('input[value=\"Submit\"]').attr('disabled')") == 'disabled' - - -def fill_field(name, info): - def fill_info(): - form_css = 'form.feedback_form' - form = world.css_find(form_css) - form.find_by_name(name).fill(info) - world.retry_on_exception(fill_info) diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index ba2661074c..e96ed1fe39 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -136,8 +136,7 @@ CC_PROCESSOR['CyberSource']['PURCHASE_ENDPOINT'] = "/shoppingcart/payment_fake" # We do not yet understand why this occurs. Setting this to true is a stopgap measure USE_I18N = True -FEATURES['ENABLE_FEEDBACK_SUBMISSION'] = True -FEEDBACK_SUBMISSION_EMAIL = 'dummy@example.com' +FEATURES['ENABLE_FEEDBACK_SUBMISSION'] = False # Include the lettuce app for acceptance testing, including the 'harvest' django-admin command INSTALLED_APPS += ('lettuce.django',)