Commit fe8f7f55 by John Eskew Committed by GitHub

Merge pull request #16022 from edx/jeskew/toxify_edx_platform_testing

Add tox testing to edx-platform.
parents d414693c be14aef5
...@@ -81,6 +81,7 @@ test_root/export_course_repos/ ...@@ -81,6 +81,7 @@ test_root/export_course_repos/
test_root/paver_logs/ test_root/paver_logs/
test_root/uploads/ test_root/uploads/
django-pyfs django-pyfs
.tox/
### Installation artifacts ### Installation artifacts
*.egg-info *.egg-info
......
...@@ -27,6 +27,7 @@ dependencies: ...@@ -27,6 +27,7 @@ dependencies:
# dependency on a version range of pbr. # dependency on a version range of pbr.
# Install a version which falls within that range. # Install a version which falls within that range.
- pip install --exists-action w pbr==0.9.0 - 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/base.txt
- pip install --exists-action w -r requirements/edx/paver.txt - pip install --exists-action w -r requirements/edx/paver.txt
- pip install --exists-action w -r requirements/edx/testing.txt - pip install --exists-action w -r requirements/edx/testing.txt
......
...@@ -6,9 +6,6 @@ defuse_xml_libs() ...@@ -6,9 +6,6 @@ defuse_xml_libs()
import contracts import contracts
contracts.disable_all() contracts.disable_all()
import openedx.core.operations
openedx.core.operations.install_memory_dumper()
import os import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cms.envs.aws") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cms.envs.aws")
......
...@@ -2468,8 +2468,7 @@ class CustomResponse(LoncapaResponse): ...@@ -2468,8 +2468,7 @@ class CustomResponse(LoncapaResponse):
msg = msg.replace('<', '<') msg = msg.replace('<', '<')
# Use etree to prettify the HTML # Use etree to prettify the HTML
msg = etree.tostring(fromstring_bs(msg, convertEntities=None), msg = etree.tostring(fromstring_bs(msg), pretty_print=True)
pretty_print=True)
msg = msg.replace('
', '') msg = msg.replace('
', '')
......
...@@ -602,7 +602,7 @@ class ModuleStoreAssetBase(object): ...@@ -602,7 +602,7 @@ class ModuleStoreAssetBase(object):
@contract( @contract(
course_key='CourseKey', asset_type='None | basestring', 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): def get_all_asset_metadata(self, course_key, asset_type, start=0, maxresults=-1, sort=None, **kwargs):
""" """
......
...@@ -16,9 +16,6 @@ defuse_xml_libs() ...@@ -16,9 +16,6 @@ defuse_xml_libs()
import contracts import contracts
contracts.disable_all() contracts.disable_all()
import openedx.core.operations
openedx.core.operations.install_memory_dumper()
import os import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.envs.aws")
......
"""
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 = [ ...@@ -26,6 +26,7 @@ PYTHON_REQ_FILES = [
'requirements/edx/pre.txt', 'requirements/edx/pre.txt',
'requirements/edx/github.txt', 'requirements/edx/github.txt',
'requirements/edx/local.txt', 'requirements/edx/local.txt',
'requirements/edx/django.txt',
'requirements/edx/base.txt', 'requirements/edx/base.txt',
'requirements/edx/paver.txt', 'requirements/edx/paver.txt',
'requirements/edx/development.txt', 'requirements/edx/development.txt',
......
...@@ -34,7 +34,6 @@ django-statici18n==1.4.0 ...@@ -34,7 +34,6 @@ django-statici18n==1.4.0
django-storages==1.4.1 django-storages==1.4.1
django-method-override==0.1.0 django-method-override==0.1.0
django-user-tasks==0.1.5 django-user-tasks==0.1.5
django==1.8.18
django-waffle==0.12.0 django-waffle==0.12.0
djangorestframework-jwt==1.11.0 djangorestframework-jwt==1.11.0
enum34==1.1.6 enum34==1.1.6
...@@ -69,9 +68,6 @@ httpretty==0.8.3 ...@@ -69,9 +68,6 @@ httpretty==0.8.3
lazy==1.1 lazy==1.1
mako==1.0.2 mako==1.0.2
Markdown>=2.6,<2.7 Markdown>=2.6,<2.7
--allow-external meliae
--allow-unverified meliae
meliae==0.4.0
mongoengine==0.10.0 mongoengine==0.10.0
MySQL-python==1.2.5 MySQL-python==1.2.5
networkx==1.7 networkx==1.7
...@@ -81,6 +77,7 @@ path.py==8.2.1 ...@@ -81,6 +77,7 @@ path.py==8.2.1
piexif==1.0.2 piexif==1.0.2
Pillow==3.4 Pillow==3.4
polib==1.0.3 polib==1.0.3
psutil==1.2.1
pycrypto>=2.6 pycrypto>=2.6
pygments==2.2.0 pygments==2.2.0
pygraphviz==1.1 pygraphviz==1.1
...@@ -118,8 +115,7 @@ pyuca==1.1 ...@@ -118,8 +115,7 @@ pyuca==1.1
wrapt==1.10.5 wrapt==1.10.5
zendesk==1.1.1 zendesk==1.1.1
# This needs to be installed *after* Cython, which is in pre.txt lxml==3.8.0
lxml==3.4.4
# Used for shopping cart's pdf invoice/receipt generation # Used for shopping cart's pdf invoice/receipt generation
reportlab==3.1.44 reportlab==3.1.44
......
...@@ -86,7 +86,6 @@ git+https://github.com/edx/django-celery.git@f87c6f914a1410463f54aebf68458c0653b ...@@ -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/django-splash.git@v0.2#egg=django-splash==0.2
-e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock -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/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/edx/RecommenderXBlock.git@0e744b393cf1f8b886fe77bc697e7d9d78d65cd6#egg=recommender-xblock==1.2
git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd39158450639e2e1dc#egg=crowdsourcehinter-xblock==0.1 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 -e git+https://github.com/edx/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock
......
# Requirements to run Paver # Requirements to run and test Paver
Paver==1.2.4 Paver==1.2.4
psutil==1.2.1
lazy==1.1 lazy==1.1
path.py==8.2.1 path.py==8.2.1
watchdog==0.8.3 watchdog==0.8.3
......
...@@ -12,6 +12,3 @@ pip==9.0.1 ...@@ -12,6 +12,3 @@ pip==9.0.1
# Numpy and scipy can't be installed in the same pip run. # Numpy and scipy can't be installed in the same pip run.
# Install numpy before other things to help resolve the problem. # Install numpy before other things to help resolve the problem.
numpy==1.6.2 numpy==1.6.2
# Needed for meliae
Cython==0.21.2
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# Requirements for the web application # Requirements for the web application
-r ../edx/pre.txt -r ../edx/pre.txt
-r ../edx/django.txt
-r ../edx/base.txt -r ../edx/base.txt
-r ../edx/local.txt -r ../edx/local.txt
-r ../edx/github.txt -r ../edx/github.txt
......
[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}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment