Commit 8e19102d by Braden MacDonald

Add Travis CI

parent 182b4803
*~
*.pyc
/.coverage
/xblock_mentoring.egg-info
/workbench.sqlite
/workbench.*
/dist
/templates
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: python run_tests.py --with-coverage --cover-package=mentoring
notifications:
email: false
......@@ -493,23 +493,22 @@ Access it at [http://localhost:8000/](http://localhost:8000).
Running tests
-------------
First, make sure the [XBlock SDK (Workbench)](https://github.com/edx/xblock-sdk)
is installed in the same virtual environment as xblock-mentoring.
From the xblock-mentoring repository root, run the tests with the
following command:
```bash
$ nosetests --with-django
$ ./run_tests.py
```
If you want to run only the integration or the unit tests, append the directory to the command. You can also run separate modules in this manner.
```bash
$ nosetests --with-django tests/unit
$ ./run_tests.py mentoring/tests/unit
```
If you have not installed the xblock-sdk in the active virtualenv,
you might also have to prepend `PYTHONPATH=".:/path/to/xblock"` to the command above.
(`/path/to/xblock` is the path to the xblock-sdk, where the workbench resides).
Adding custom scenarios to the workbench
----------------------------------------
......
......@@ -339,4 +339,4 @@ class MentoringAssessmentTest(MentoringBaseTest):
controls.try_again.click()
# this is a wait and assertion all together - it waits until expected text is in mentoring block
# and it fails with PrmoiseFailed exception if it's not
self.wait_until_text_in(self.question_text(0), mentoring)
\ No newline at end of file
self.wait_until_text_in(self.question_text(0), mentoring)
......@@ -233,4 +233,4 @@ class MCQBlockTest(MentoringBaseTest):
submit.click()
self.wait_until_disabled(submit)
self.assertIn('Congratulations!', messages.text)
\ No newline at end of file
self.assertIn('Congratulations!', messages.text)
ddt
-e .
unicodecsv==0.9.4
-e git://github.com/nosedjango/nosedjango.git@ed7d7f9aa969252ff799ec159f828eaa8c1cbc5a#egg=nosedjango-dev
-e git://github.com/edx-solutions/xblock-utils.git#egg=xblock-utils
-e .
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Run tests for the Mentoring XBlock
This script is required to run our selenium tests inside the xblock-sdk workbench
because the workbench SDK's settings file is not inside any python module.
"""
import os
import sys
import workbench
if __name__ == "__main__":
# Find the location of the XBlock SDK. Note: it must be installed in development mode.
# ('python setup.py develop' or 'pip install -e')
xblock_sdk_dir = os.path.dirname(os.path.dirname(workbench.__file__))
sys.path.append(xblock_sdk_dir)
# Use the workbench settings file:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "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 = ["mentoring/tests/"]
options = [arg for arg in args if arg not in paths]
execute_from_command_line([sys.argv[0], "test"] + paths + options)
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