Commit 286e4752 by Will Daly

Merge pull request #1 from edx/will/testing-infrastructure

Added nose and lettuce test infrastructure
parents a4656ed8 08bfa52b
language: python
python:
- "2.7"
install: pip install nose
script: nosetests
install:
- "pip install -r requirements/base.txt --use-mirrors"
- "pip install -r requirements/test.txt --use-mirrors"
script:
- "python manage.py test"
- "python manage.py harvest"
Feature: Bootstrap
In order to verify that lettuce is working in Travis.
As a Test Engineer
I want to run a dummy BDD spec.
Scenario: Dummy spec
Given: I have defined a step
And: I have implemented the step in lettuce
Then: The spec should run in Travis
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I have defined a step')
def given_i_have_defined_a_step(step):
pass
@step(u'And: I have implemented the step in lettuce')
def and_i_have_implemented_the_step_in_lettuce(step):
pass
@step(u'Then: The spec should run in Travis')
def then_the_spec_should_run_in_travis(step):
pass
......@@ -3,7 +3,14 @@ import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "common_grading.settings")
# For convenience, use the test-specific settings by default
# when running nose or lettuce test suites.
# Otherwise, use the base settings.
if 'test' in sys.argv or 'harvest' in sys.argv:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.test")
else:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.base")
from django.core.management import execute_from_command_line
......
Feature: Bootstrap
In order to verify that lettuce is working in Travis.
As a Test Engineer
I want to run a dummy BDD spec.
Scenario: Dummy spec
Given: I have defined a step
And: I have implemented the step in lettuce
Then: The spec should run in Travis
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I have defined a step')
def given_i_have_defined_a_step(step):
pass
@step(u'And: I have implemented the step in lettuce')
def and_i_have_implemented_the_step_in_lettuce(step):
pass
@step(u'Then: The spec should run in Travis')
def then_the_spec_should_run_in_travis(step):
pass
# edX Internal Requirements
# Third Party Requirements
# Test Requirements
django==1.4.8
djangorestframework==2.3.5
django-nose==1.2
mock==1.0.1
nose==1.3.0
coverage==3.7.1
lettuce==0.2.19
pep8==1.4.6
pylint<1.0
"""
Test-specific Django settings.
"""
# Inherit from base settings
from .base import *
TEST_APPS = ('common_grading', 'peer_grading')
# Configure nose
NOSE_ARGS = [
'--with-coverage',
'--cover-package=' + ",".join(TEST_APPS)
]
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Configure lettuce
LETTUCE_APPS = TEST_APPS
LETTUCE_SERVER_PORT = 8005
# Install test-specific Django apps
INSTALLED_APPS += ('django_nose', 'lettuce.django')
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