From 990c72ca8ef953ba4af0ffeb2ff3d3b729aea5ff Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 16:51:35 -0700 Subject: [PATCH 1/9] Adding a new settings.test module. This module will be used to run all tests locally using an in-memory sqlite3 database to prevent bootstrapping issues as much as possible. --- settings/test.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 settings/test.py diff --git a/settings/test.py b/settings/test.py new file mode 100644 index 000000000..393beab24 --- /dev/null +++ b/settings/test.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +"""Local test settings and globals which allows us to run our test suite +locally. +""" + + +from settings.base import * + + +########## DEBUG +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +# serve media through the staticfiles app. +SERVE_MEDIA = DEBUG + + +########## TEST +TEST_RUNNER = 'testrunner.OurCoverageRunner' + +COVERAGE_MODULE_EXCLUDES = [ + 'tests$', 'settings$', 'urls$', 'locale$', + 'migrations', 'fixtures', 'big_email_send$', + 'load_dev_data$', 'fix_grid_element$', + 'package_updater$', 'searchv2_build$' +] +COVERAGE_MODULE_EXCLUDES += PREREQ_APPS + ["djkombu", ] +COVERAGE_REPORT_HTML_OUTPUT_DIR = "coverage" + + +########## DATABASES +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": ":memory:", + "USER": "", + "PASSWORD": "", + "HOST": "", + "PORT": "", + }, +} From 99a3257cf5e40cd3c5cf227ae535e1eff610482d Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:07:54 -0700 Subject: [PATCH 2/9] Updating contributing / testing documentation. The docs now properly reference our new 'settings.test' module which should be used for running all local unit tests. --- docs/contributing.rst | 2 +- docs/testing_instructions.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing.rst b/docs/contributing.rst index 467a4aa5a..b6b932221 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -117,7 +117,7 @@ Run the tests! Before you submit a pull request, please run the entire OpenComparison test suite via:: - python manage.py test --settings=settings.base + python manage.py test --settings=settings.test The first thing the core committers will do is run this command. Any pull request that fails this test suite will be **rejected**. diff --git a/docs/testing_instructions.rst b/docs/testing_instructions.rst index 75279bb2c..b25a17112 100644 --- a/docs/testing_instructions.rst +++ b/docs/testing_instructions.rst @@ -8,8 +8,8 @@ Running the test suite To run all of the Packaginator tests:: - python manage.py test --settings.base + python manage.py test --settings.test To run tests for a particular Packaginator app, for example the feeds app:: - python manage.py test feeds --settings.base \ No newline at end of file + python manage.py test feeds --settings.test From cbd07e7f1ea2aae6fe74c25ef3c19362a191b109 Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:09:56 -0700 Subject: [PATCH 3/9] Removing all testing customizations from settings.base module. These belong in the settings.test module only! --- settings/base.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/settings/base.py b/settings/base.py index 8e99cc36e..d93c5d27a 100644 --- a/settings/base.py +++ b/settings/base.py @@ -200,18 +200,6 @@ 'django.template.loaders.app_directories.Loader', ) -#TEST_RUNNER = 'testrunner.OurTestRunner' -TEST_RUNNER = 'testrunner.OurCoverageRunner' - -COVERAGE_MODULE_EXCLUDES = [ - 'tests$', 'settings$', 'urls$', 'locale$', - 'migrations', 'fixtures', 'big_email_send$', - 'load_dev_data$', 'fix_grid_element$', - 'package_updater$', 'searchv2_build$' -] -COVERAGE_MODULE_EXCLUDES += PREREQ_APPS + ["djkombu", ] -COVERAGE_REPORT_HTML_OUTPUT_DIR = "coverage" - PACKAGINATOR_HELP_TEXT = { "REPO_URL": "Enter your project repo hosting URL here.
Example: https://github.com/opencomparison/opencomparison", "PYPI_URL": "Leave this blank if this package does not have a PyPI release.
What PyPI uses to index your package.
Example: django-uni-form", From 382856b66a5860d495f4b81d1619c3d402b5e139 Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:12:49 -0700 Subject: [PATCH 4/9] Removing unnecessar comment from settings.test. --- settings/test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/settings/test.py b/settings/test.py index 393beab24..1137c32e2 100644 --- a/settings/test.py +++ b/settings/test.py @@ -10,8 +10,6 @@ ########## DEBUG DEBUG = True TEMPLATE_DEBUG = DEBUG - -# serve media through the staticfiles app. SERVE_MEDIA = DEBUG From 402e4afdcb2c23fca4b2b66eadc90eab7068708a Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:17:54 -0700 Subject: [PATCH 5/9] Making settings.travis inherit from settings.test. This way we get our test runner configuration stuff. --- settings/travis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/travis.py b/settings/travis.py index f9e5a2153..84db0212d 100644 --- a/settings/travis.py +++ b/settings/travis.py @@ -4,7 +4,7 @@ """ -from settings.base import * +from settings.test import * DATABASES = { From 8d5aebdf466a5f689132bcb16cff1068efc93ec4 Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:18:19 -0700 Subject: [PATCH 6/9] We don't actually need our Travis CI test module. Because our new generic 'test' module does everything. --- settings/travis.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 settings/travis.py diff --git a/settings/travis.py b/settings/travis.py deleted file mode 100644 index 84db0212d..000000000 --- a/settings/travis.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -"""TravisCI settings which allow us to run our test suite on the TravisCI -continuous integration service. -""" - - -from settings.test import * - - -DATABASES = { - "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": ":memory:", - "USER": "", - "PASSWORD": "", - "HOST": "", - "PORT": "", - }, -} From f390b67b17de62379b5934b01ad37f825107435a Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:18:48 -0700 Subject: [PATCH 7/9] Updating our travis.yml to use our new settings.test module. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fb8e8bc75..c8428e489 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ python: install: - pip install -r requirements/project.txt script: - - python manage.py test --settings=settings.travis + - python manage.py test --settings=settings.test From 680c72db2952d9154d7490eaf447c9bede6622f9 Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:21:17 -0700 Subject: [PATCH 8/9] Adding myself to CONTRIBUTORS. --- CONTRIBUTORS.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 23b8521a4..5d48d9304 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -66,6 +66,7 @@ Direct Contributors * Nolan Brubaker * PA Parent * Preston Holmes +* Randall Degges * Skot Carruth * Stuart Powers * Szilveszter Farkas (Repo Man) @@ -77,4 +78,4 @@ Direct Contributors Other Contributors ================== -* The entire Python community for providing us the tools we needed to build this thing. \ No newline at end of file +* The entire Python community for providing us the tools we needed to build this thing. From 8a609559a9a8636b02cef0b2c19d8b3cc3068c9e Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Sat, 12 May 2012 17:23:47 -0700 Subject: [PATCH 9/9] Remving myself from contributors =p --- CONTRIBUTORS.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 6457b0446..617b496d9 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -67,7 +67,6 @@ Direct Contributors * Randall Degges * PA Parent * Preston Holmes -* Randall Degges * Skot Carruth * Stuart Powers * Szilveszter Farkas (Repo Man)