From f2c417b638b09002fa1ba51675e7bf155436502f Mon Sep 17 00:00:00 2001 From: Will Daly Date: Wed, 16 Oct 2013 10:13:26 -0400 Subject: [PATCH 1/2] Write Django logs to file during acceptance tests --- cms/envs/acceptance.py | 5 +++-- lms/envs/acceptance.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index e5ed2261b5..51e3183a52 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -14,9 +14,10 @@ from lms.envs.sauce import * # otherwise the browser will not render the pages correctly DEBUG = True -# Disable warnings for acceptance tests, to make the logs readable +# Output Django logs to a file import logging -logging.disable(logging.ERROR) +logging.basicConfig(filename=TEST_ROOT / "log" / "cms_acceptance.log", level=logging.ERROR) + import os from random import choice, randint diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index 9f2f0866db..5414705b79 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -14,9 +14,10 @@ from .sauce import * # otherwise the browser will not render the pages correctly DEBUG = True -# Disable warnings for acceptance tests, to make the logs readable +# Output Django logs to a file import logging -logging.disable(logging.ERROR) +logging.basicConfig(filename=TEST_ROOT / "log" / "lms_acceptance.log", level=logging.ERROR) + import os from random import choice, randint import string From c1a5f18e9b67a92c9fa5962732473487bd01e21e Mon Sep 17 00:00:00 2001 From: Will Daly Date: Thu, 17 Oct 2013 14:17:48 -0400 Subject: [PATCH 2/2] Updated testing docs --- docs/internal/testing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/internal/testing.md b/docs/internal/testing.md index 14cc2879b3..cc8ab7deef 100644 --- a/docs/internal/testing.md +++ b/docs/internal/testing.md @@ -231,6 +231,8 @@ Acceptance tests will run on a randomized port and can be run in the background To specify the port, change the LETTUCE_SERVER_PORT constant in cms/envs/acceptance.py and lms/envs/acceptance.py as well as the port listed in cms/djangoapps/contentstore/feature/upload.py +During acceptance test execution, Django log files are written to `test_root/log/lms_acceptance.log` and `test_root/log/cms_acceptance.log`. + **Note**: The acceptance tests can *not* currently run in parallel. ## Viewing Test Coverage