Skip to content

Commit

Permalink
Setup postgres for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
vtemian committed Mar 4, 2020
1 parent 6b86d41 commit 74898f0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
language: python

services: postgresql

before_script:
- psql -c "CREATE DATABASE travisci;" -U postgres

matrix:
include:
- python: 3.6
Expand All @@ -9,11 +15,14 @@ matrix:
env: TOXENV=py37-22
- python: 3.7
env: TOXENV=py37-30

# command to install dependencies
install:
- pip install tox

# command to run tests
script:
- tox -e $TOXENV

# containers
sudo: false
15 changes: 15 additions & 0 deletions moonsheep/tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from moonsheep.settings import * #NOQA

SECRET_KEY = 'fake-key'
Expand All @@ -8,12 +10,25 @@
'django.contrib.contenttypes',
]


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}

if 'TRAVIS' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'travisci',
'USER': 'postgres',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
}
}

MOONSHEEP_TASK_SOURCE = ''
MOONSHEEP_BASE_TASKS = ['task1', 'task2']

0 comments on commit 74898f0

Please sign in to comment.