Merge pull request #16022 from edx/jeskew/toxify_edx_platform_testing
Add tox testing to edx-platform.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -81,6 +81,7 @@ test_root/export_course_repos/
|
||||
test_root/paver_logs/
|
||||
test_root/uploads/
|
||||
django-pyfs
|
||||
.tox/
|
||||
|
||||
### Installation artifacts
|
||||
*.egg-info
|
||||
|
||||
@@ -27,6 +27,7 @@ dependencies:
|
||||
# dependency on a version range of pbr.
|
||||
# Install a version which falls within that range.
|
||||
- pip install --exists-action w pbr==0.9.0
|
||||
- pip install --exists-action w -r requirements/edx/django.txt
|
||||
- pip install --exists-action w -r requirements/edx/base.txt
|
||||
- pip install --exists-action w -r requirements/edx/paver.txt
|
||||
- pip install --exists-action w -r requirements/edx/testing.txt
|
||||
|
||||
@@ -6,9 +6,6 @@ defuse_xml_libs()
|
||||
import contracts
|
||||
contracts.disable_all()
|
||||
|
||||
import openedx.core.operations
|
||||
openedx.core.operations.install_memory_dumper()
|
||||
|
||||
import os
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cms.envs.aws")
|
||||
|
||||
|
||||
@@ -2468,8 +2468,7 @@ class CustomResponse(LoncapaResponse):
|
||||
msg = msg.replace('<', '<')
|
||||
|
||||
# Use etree to prettify the HTML
|
||||
msg = etree.tostring(fromstring_bs(msg, convertEntities=None),
|
||||
pretty_print=True)
|
||||
msg = etree.tostring(fromstring_bs(msg), pretty_print=True)
|
||||
|
||||
msg = msg.replace(' ', '')
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ class ModuleStoreAssetBase(object):
|
||||
|
||||
@contract(
|
||||
course_key='CourseKey', asset_type='None | basestring',
|
||||
start='int | None', maxresults='int | None', sort='tuple(str,(int,>=1,<=2))|None'
|
||||
start='int | None', maxresults='int | None', sort='tuple(str,int) | None'
|
||||
)
|
||||
def get_all_asset_metadata(self, course_key, asset_type, start=0, maxresults=-1, sort=None, **kwargs):
|
||||
"""
|
||||
|
||||
@@ -16,9 +16,6 @@ defuse_xml_libs()
|
||||
import contracts
|
||||
contracts.disable_all()
|
||||
|
||||
import openedx.core.operations
|
||||
openedx.core.operations.install_memory_dumper()
|
||||
|
||||
import os
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws")
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
"""
|
||||
Workflows useful for reporting on runtime characteristics of the system
|
||||
"""
|
||||
import gc
|
||||
import os
|
||||
import signal
|
||||
import tempfile
|
||||
from datetime import datetime
|
||||
|
||||
from meliae import scanner
|
||||
|
||||
|
||||
def dump_memory(signum, frame):
|
||||
"""
|
||||
Dump memory stats for the current process to a temp directory.
|
||||
Uses the meliae output format.
|
||||
"""
|
||||
|
||||
timestamp = datetime.now().isoformat()
|
||||
format_str = '{}/meliae.{}.{}.{{}}.dump'.format(
|
||||
tempfile.gettempdir(),
|
||||
timestamp,
|
||||
os.getpid(),
|
||||
)
|
||||
|
||||
scanner.dump_all_objects(format_str.format('pre-gc'))
|
||||
|
||||
# force garbarge collection
|
||||
for gen in xrange(3):
|
||||
gc.collect(gen)
|
||||
scanner.dump_all_objects(
|
||||
format_str.format("gc-gen-{}".format(gen))
|
||||
)
|
||||
|
||||
|
||||
def install_memory_dumper(dump_signal=signal.SIGPROF):
|
||||
"""
|
||||
Install a signal handler on `signal` to dump memory stats for the current process.
|
||||
"""
|
||||
signal.signal(dump_signal, dump_memory)
|
||||
@@ -26,6 +26,7 @@ PYTHON_REQ_FILES = [
|
||||
'requirements/edx/pre.txt',
|
||||
'requirements/edx/github.txt',
|
||||
'requirements/edx/local.txt',
|
||||
'requirements/edx/django.txt',
|
||||
'requirements/edx/base.txt',
|
||||
'requirements/edx/paver.txt',
|
||||
'requirements/edx/development.txt',
|
||||
|
||||
@@ -34,7 +34,6 @@ django-statici18n==1.4.0
|
||||
django-storages==1.4.1
|
||||
django-method-override==0.1.0
|
||||
django-user-tasks==0.1.5
|
||||
django==1.8.18
|
||||
django-waffle==0.12.0
|
||||
djangorestframework-jwt==1.11.0
|
||||
enum34==1.1.6
|
||||
@@ -69,9 +68,6 @@ httpretty==0.8.3
|
||||
lazy==1.1
|
||||
mako==1.0.2
|
||||
Markdown>=2.6,<2.7
|
||||
--allow-external meliae
|
||||
--allow-unverified meliae
|
||||
meliae==0.4.0
|
||||
mongoengine==0.10.0
|
||||
MySQL-python==1.2.5
|
||||
networkx==1.7
|
||||
@@ -81,6 +77,7 @@ path.py==8.2.1
|
||||
piexif==1.0.2
|
||||
Pillow==3.4
|
||||
polib==1.0.3
|
||||
psutil==1.2.1
|
||||
pycrypto>=2.6
|
||||
pygments==2.2.0
|
||||
pygraphviz==1.1
|
||||
@@ -118,8 +115,7 @@ pyuca==1.1
|
||||
wrapt==1.10.5
|
||||
zendesk==1.1.1
|
||||
|
||||
# This needs to be installed *after* Cython, which is in pre.txt
|
||||
lxml==3.4.4
|
||||
lxml==3.8.0
|
||||
|
||||
# Used for shopping cart's pdf invoice/receipt generation
|
||||
reportlab==3.1.44
|
||||
|
||||
1
requirements/edx/django.txt
Normal file
1
requirements/edx/django.txt
Normal file
@@ -0,0 +1 @@
|
||||
Django==1.8.18
|
||||
@@ -86,7 +86,6 @@ git+https://github.com/edx/django-celery.git@f87c6f914a1410463f54aebf68458c0653b
|
||||
-e git+https://github.com/edx/django-splash.git@v0.2#egg=django-splash==0.2
|
||||
-e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock
|
||||
git+https://github.com/edx/edx-ora2.git@2.1.1#egg=ora2==2.1.1
|
||||
git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3
|
||||
git+https://github.com/edx/RecommenderXBlock.git@0e744b393cf1f8b886fe77bc697e7d9d78d65cd6#egg=recommender-xblock==1.2
|
||||
git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd39158450639e2e1dc#egg=crowdsourcehinter-xblock==0.1
|
||||
-e git+https://github.com/edx/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Requirements to run Paver
|
||||
# Requirements to run and test Paver
|
||||
Paver==1.2.4
|
||||
psutil==1.2.1
|
||||
lazy==1.1
|
||||
path.py==8.2.1
|
||||
watchdog==0.8.3
|
||||
|
||||
@@ -12,6 +12,3 @@ pip==9.0.1
|
||||
# Numpy and scipy can't be installed in the same pip run.
|
||||
# Install numpy before other things to help resolve the problem.
|
||||
numpy==1.6.2
|
||||
|
||||
# Needed for meliae
|
||||
Cython==0.21.2
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
# Requirements for the web application
|
||||
-r ../edx/pre.txt
|
||||
-r ../edx/django.txt
|
||||
-r ../edx/base.txt
|
||||
-r ../edx/local.txt
|
||||
-r ../edx/github.txt
|
||||
|
||||
22
tox.ini
Normal file
22
tox.ini
Normal file
@@ -0,0 +1,22 @@
|
||||
[tox]
|
||||
envlist = py27-django{18,111}
|
||||
|
||||
[testenv]
|
||||
setenv =
|
||||
PYTHONHASHSEED = 0
|
||||
passenv =
|
||||
EDX_PLATFORM_SETTINGS
|
||||
EDXAPP_TEST_MONGO_HOST
|
||||
deps =
|
||||
django18: Django>=1.8,<1.9
|
||||
django111: Django>=1.11,<2
|
||||
-rrequirements/edx/pre.txt
|
||||
-rrequirements/edx/github.txt
|
||||
-rrequirements/edx/local.txt
|
||||
-rrequirements/edx/base.txt
|
||||
-rrequirements/edx/development.txt
|
||||
-rrequirements/edx/testing.txt
|
||||
-rrequirements/edx/post.txt
|
||||
|
||||
commands =
|
||||
pytest {posargs}
|
||||
Reference in New Issue
Block a user