Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
Improve .travis.yml to execute django tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannu Kamarainen committed May 16, 2017
1 parent 2218a60 commit 7a28686
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
32 changes: 14 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,33 @@ language: python
python: 3.5.1
branches:
only:
- dev
- staging
- stable
- master
cache: pip
env:
global:
- DJANGO_SETTINGS_MODULE="settings.py"
addons:
postgresql: '9.6'
services:
- postgresql
before_install:
- openssl aes-256-cbc -K $encrypted_596a6d1c4f83_key -iv $encrypted_596a6d1c4f83_iv -in deploy-key.enc -out deploy-key -d
- rm deploy-key.enc
- chmod 600 deploy-key
- mv deploy-key ~/.ssh/id_rsa
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
# before_install:
# - openssl aes-256-cbc -K $encrypted_596a6d1c4f83_key -iv $encrypted_596a6d1c4f83_iv -in deploy-key.enc -out deploy-key -d
# - rm deploy-key.enc
# - chmod 600 deploy-key
# - mv deploy-key ~/.ssh/id_rsa
# - eval "$(ssh-agent -s)"
# - ssh-add ~/.ssh/id_rsa
install:
- pip install ansible
- pip install -r requirements.txt
- sudo service postgresql restart
before_script:
- psql -U postgres < resources/sql/init_test.sql
script: true
#- flake8 .
#- python manage.py makemigrations
#- python manage.py migrate
#- python manage.py populate_history --auto
#- python manage.py loaddata resources/data/test_data.json
#- python manage.py test
script:
- cd src
- flake8 .
- python manage.py makemigrations metax_api
- python manage.py migrate metax_api
- python manage.py test
#- coverage run manage.py test metax-api
after_success:
- $TRAVIS_BUILD_DIR/.travis-deploy.sh
Expand Down
1 change: 1 addition & 0 deletions resources/sql/init_test.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- Create metax test user and test db

CREATE USER metax_test;
ALTER USER metax_test CREATEDB;
CREATE DATABASE metax_db_test OWNER metax_test ENCODING 'UTF8';

0 comments on commit 7a28686

Please sign in to comment.