Skip to content

Commit

Permalink
Add comments and refactor Travis-ci config
Browse files Browse the repository at this point in the history
 - Remove the database setup from the local configuration settings because it is not currently needed to make the tests pass
 - Refactor the system-wide dependency installations into the `.travis.yml` config to leverage the Travis CI container technology
 - Re-enable the javascript tests because the tests are passing
  • Loading branch information
Luke Swart committed Jun 14, 2015
1 parent 19b5c3b commit 6ab62a9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 27 deletions.
21 changes: 18 additions & 3 deletions .travis.yml
@@ -1,10 +1,25 @@
# https://github.com/travis-ci/travis-ci/wiki/.travis.yml-options

install: "ci/install.sh"
script: "ci/script.sh"
python:
- "2.6"
- "2.7"

# This is redundant, but explicit,, since 'sudo' is disabled by default to
# make use of Travis CI's container technology.
sudo: false

# Exporting our $HOME gets us around the 'sudo pip install...' issue
# Inpiration for this fix found here:
# https://github.com/travis-ci/travis-ci/issues/3563
before_script:
- export PATH=$HOME/.local/bin:$PATH
- pip install -r requirements.txt --user `whoami`
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

install: "ci/install.sh"

script: "ci/script.sh"
notifications:
irc:
channels:
Expand All @@ -21,4 +36,4 @@ notifications:
# - foo@bar.com
# - foo2@bar.com
# on_success: change
# on_failure: change
# on_failure: change
7 changes: 0 additions & 7 deletions ci/install.sh
@@ -1,11 +1,4 @@
#!/bin/sh

# libevent development files are required for gevent
sudo apt-get install libevent-dev

# Install the python requirements
sudo pip install -r requirements.txt

# Initialize the project settings
cp src/project/local_settings.py.template src/project/local_settings.py

Expand Down
9 changes: 9 additions & 0 deletions ci/script.sh
Expand Up @@ -4,3 +4,12 @@ STATUS=$?
if [ $STATUS -ne 0 ]
then exit $STATUS
fi

# Change to the jasmine directory and run the JS tests
cd src/sa_web/jasmine/
bundle exec rake jasmine:ci
STATUS=$?
if [ $STATUS -ne 0 ]
then exit $STATUS
fi
cd ../../..
34 changes: 17 additions & 17 deletions src/project/local_settings.py.template
Expand Up @@ -27,21 +27,21 @@ MAPQUEST_KEY = 'Fmjtd%7Cluur2g0bnl%2C25%3Do5-9at29u'
# Unless you are running both the map and API locally, delete/comment out everything below.

# API settings
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'shareabouts-old',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'localhost',
'PORT': '5432',
}
}

REST_FRAMEWORK = {
'PAGINATE_BY': 500,
'PAGINATE_BY_PARAM': 'page_size'
}

BROKER_URL = 'django://'
#DATABASES = {
# 'default': {
# 'ENGINE': 'django.contrib.gis.db.backends.postgis',
# 'NAME': 'shareabouts-old',
# 'USER': 'postgres',
# 'PASSWORD': 'postgres',
# 'HOST': 'localhost',
# 'PORT': '5432',
# }
#}
#
#REST_FRAMEWORK = {
# 'PAGINATE_BY': 500,
# 'PAGINATE_BY_PARAM': 'page_size'
#}
#
#BROKER_URL = 'django://'

0 comments on commit 6ab62a9

Please sign in to comment.