diff --git a/.travis.yml b/.travis.yml index d1c909bc2cda..9c5129d3c647 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: python python: - "2.7" +services: + - mongodb + node_js: 6 cache: @@ -20,10 +23,9 @@ install: env: - TOXENV=pep8 - - TOXENV=py27-django111 - ARGS="-- paver run_pep8" - - TOXENV=py27-django111 - ARGS="-- pytest common/djangoapps/student/tests/test_helpers.py::TestDestroyOAuthTokensHelper" + - TOXENV=py27-paver-pep8 + - TOXENV=py27-studio + - TOXENV=py27-lms script: - tox $ARGS diff --git a/common/test/appsembler/customer_themes/.gitignore b/common/test/appsembler/customer_themes/.gitignore new file mode 100644 index 000000000000..d6b7ef32c847 --- /dev/null +++ b/common/test/appsembler/customer_themes/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/common/test/appsembler/appsembler-theme/customer_specific/lms/static/sass/base/_branding-basics.scss b/common/test/appsembler/edx-theme-codebase/customer_specific/lms/static/sass/base/_branding-basics.scss similarity index 100% rename from common/test/appsembler/appsembler-theme/customer_specific/lms/static/sass/base/_branding-basics.scss rename to common/test/appsembler/edx-theme-codebase/customer_specific/lms/static/sass/base/_branding-basics.scss diff --git a/common/test/appsembler/appsembler-theme/lms/static/sass/brand.scss b/common/test/appsembler/edx-theme-codebase/lms/static/sass/_brand.scss similarity index 100% rename from common/test/appsembler/appsembler-theme/lms/static/sass/brand.scss rename to common/test/appsembler/edx-theme-codebase/lms/static/sass/_brand.scss diff --git a/common/test/appsembler/appsembler-theme/lms/static/sass/main.scss b/common/test/appsembler/edx-theme-codebase/lms/static/sass/main.scss similarity index 100% rename from common/test/appsembler/appsembler-theme/lms/static/sass/main.scss rename to common/test/appsembler/edx-theme-codebase/lms/static/sass/main.scss diff --git a/common/test/customer_themes/.gitkeep b/common/test/customer_themes/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/openedx/core/djangoapps/site_configuration/tests/test_tahoe_changes.py b/openedx/core/djangoapps/site_configuration/tests/test_tahoe_changes.py index 6302da6df63a..d300a31af453 100644 --- a/openedx/core/djangoapps/site_configuration/tests/test_tahoe_changes.py +++ b/openedx/core/djangoapps/site_configuration/tests/test_tahoe_changes.py @@ -1,20 +1,18 @@ """ Tests for site configuration's Tahoe customizations. """ -from mock import patch -import unittest +from os import getenv -from django.test import TestCase -from django.db import IntegrityError, transaction +from django.conf import settings from django.contrib.sites.models import Site +from django.test import TestCase from django.test.utils import override_settings from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory -# TODO: This is an integration test, try to make it less so and more of a unit-test. @override_settings( - COMPREHENSIVE_THEME_DIRS=['/edx/src/themes'], + COMPREHENSIVE_THEME_DIRS=[settings.REPO_ROOT / 'common/test/appsembler'], ENABLE_COMPREHENSIVE_THEMING=True, DEFAULT_SITE_THEME='edx-theme-codebase', ) diff --git a/requirements/edx/appsembler.txt b/requirements/edx/appsembler.txt index aa39d935cdae..0c785b07c9bf 100644 --- a/requirements/edx/appsembler.txt +++ b/requirements/edx/appsembler.txt @@ -6,7 +6,7 @@ requests==2.9.1 django-anymail==5.0 django-tiers==0.0.20 dj-database-url==0.4.2 -psycopg2==2.8.3 +psycopg2-binary==2.8.3 django-compat==1.0.14 django-hijack==2.1.4 django-hijack-admin==2.1.4 diff --git a/tox.ini b/tox.ini index 4e041596dd53..e57636e9850f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,35}-django{18,19,110,111} +envlist = py27-{paver-pep8,studio,lms},pep8 # This is needed to prevent the lms, cms, and openedx packages inside the "Open # edX" package (defined in setup.py) from getting installed into site-packages @@ -45,12 +45,9 @@ passenv = SKIP_NPM_INSTALL TEST_SUITE deps = - django18: Django>=1.8,<1.9 - django19: Django>=1.9,<1.10 - django110: Django>=1.10,<1.11 - django111: Django>=1.11,<2 - -r requirements/edx/testing.txt - -r requirements/edx/appsembler.txt + Django>=1.11,<2 + -r{toxinidir}/requirements/edx/testing.txt + -r{toxinidir}/requirements/edx/appsembler.txt whitelist_externals = /bin/bash /usr/bin/curl @@ -61,6 +58,36 @@ commands = # Now perform testing. {posargs} +[testenv:py27-paver-pep8] +commands = + # Upgrade sqlite to fix crashes during testing. + bash scripts/upgrade_pysqlite.sh + paver run_pep8 + +[testenv:py27-studio] +commands = + # Upgrade sqlite to fix crashes during testing. + bash scripts/upgrade_pysqlite.sh + # Avoid caching edx-platform's entry_points + pip install -r requirements/edx/local.in + pytest cms/djangoapps/contentstore/views/tests/test_assets.py::AssetToJsonTestCase + +[testenv:py27-lms] +commands = + # Upgrade sqlite to fix crashes during testing. + bash scripts/upgrade_pysqlite.sh + # Avoid caching edx-platform's entry_points + pip install -r requirements/edx/local.in + pytest \ + lms/djangoapps/course_api/ \ + lms/djangoapps/course_blocks/transformers/tests/test_load_override_data.py \ + lms/djangoapps/grades/tests/integration/test_events.py \ + lms/djangoapps/instructor/tests/test_certificates.py::CertificatesInstructorApiTest \ + openedx/core/djangoapps/appsembler \ + openedx/core/djangoapps/site_configuration/tests/test_tahoe_changes.py \ + openedx/core/djangoapps/user_api/accounts/tests/test_utils.py::CompletionUtilsTestCase + + [testenv:pep8] deps = pycodestyle==2.3.1