Commit f0ac0aca by Braden MacDonald

Add test runner script and support for Travis CI

parent 34036b57
*.log
*.pyc
.coverage
xblock_utils.egg-info
tests.integration.*.png
language: python
python:
- "2.7"
before_install:
- "export DISPLAY=:99"
- "sh -e /etc/init.d/xvfb start"
install:
- "pip install -e git://github.com/edx/xblock-sdk.git#egg=xblock-sdk"
- "pip install -r $VIRTUAL_ENV/src/xblock-sdk/requirements.txt"
- "pip install -r $VIRTUAL_ENV/src/xblock-sdk/test-requirements.txt"
- "pip install -r requirements.txt"
script:
- pep8 xblockutils --max-line-length=120
- pylint xblockutils
- python run_tests.py --with-coverage --cover-package=xblockutils
notifications:
email: false
branches:
only:
- master
......@@ -10,4 +10,4 @@ test base classes and documentation shared by many XBlocks.
To test the utilities, run::
nosetests --with-coverage --cover-package xblockutils --cover-html
./run_tests.py
[REPORTS]
reports=no
[FORMAT]
max-line-length=120
[MESSAGES CONTROL]
disable=
abstract-class-not-used,
broad-except,
fixme,
invalid-name,
locally-disabled,
maybe-no-member,
protected-access,
star-args,
too-few-public-methods,
too-many-public-methods,
too-many-ancestors,
too-many-arguments,
too-many-locals,
unused-argument
[SIMILARITIES]
min-similarity-lines=8
......@@ -3,5 +3,5 @@
# XBlock
# This is not in/from PyPi, since it moves fast
-e git+https://github.com/edx/XBlock.git@f0e53538be7ce90584a03cc7dd3f06bd43e12ac2#egg=XBlock
-e git+https://github.com/edx/XBlock.git@8e496cff186ed33cf92964faab13ccb3691ee211#egg=XBlock
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Run tests for XBlock-utils
"""
import os
import sys
if __name__ == "__main__":
# Use the workbench settings file:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "workbench.settings")
# Configure a range of ports in case the default port of 8081 is in use
os.environ.setdefault("DJANGO_LIVE_TEST_SERVER_ADDRESS", "localhost:8081-8099")
from django.core.management import execute_from_command_line
args = sys.argv[1:]
paths = [arg for arg in args if arg[0] != '-']
if not paths:
paths = ["tests/"]
options = [arg for arg in args if arg not in paths]
execute_from_command_line([sys.argv[0], "test"] + paths + options)
......@@ -67,7 +67,7 @@ class ResourceLoader(object):
scenarios = []
if os.path.isdir(scenario_dir):
for template in os.listdir(scenario_dir):
for template in sorted(os.listdir(scenario_dir)):
if not template.endswith('.xml'):
continue
identifier = template[:-4]
......
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