mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-11-22 06:15:02 +01:00
Test API using pytest and PostgreSQL on Travis
First attempt at getting the Travis Docker setup correct. Inspired by the Travis pipenv setup used in Responder. See: https://docs.travis-ci.com/user/docker/ See: https://github.com/kennethreitz/responder/blob/master/.travis.yml
This commit is contained in:
parent
061d0a8f5f
commit
d40b2f0b2e
16
.travis.yml
16
.travis.yml
@ -3,6 +3,20 @@ python:
|
||||
- "3.5"
|
||||
- "3.6"
|
||||
- "3.7-dev"
|
||||
script: pip install -r requirements.txt
|
||||
sudo: required
|
||||
services: docker
|
||||
before_install:
|
||||
- docker pull postgres:9.5-alpine
|
||||
- docker run -d --name dspacestatistics -p 5432:5432 postgres:9.5-alpine
|
||||
- docker ps -a
|
||||
- docker exec dspacestatistics createuser -U postgres dspacestatistics
|
||||
- docker exec dspacestatistics psql -U postgres -c "ALTER USER dspacestatistics WITH PASSWORD 'dspacestatistics'"
|
||||
- docker exec dspacestatistics createdb -U postgres -O dspacestatistics --encoding=UNICODE dspacestatistics
|
||||
- docker cp tests/dspacestatistics.sql dspacestatistics:/tmp
|
||||
- docker exec dspacestatistics sh -c 'psql -U postgres -d dspacestatistics < /tmp/dspacestatistics.sql'
|
||||
install:
|
||||
- "pip install pipenv --upgrade-strategy=only-if-needed"
|
||||
- "pipenv install --dev"
|
||||
script: pytest
|
||||
|
||||
# vim: ts=2 sw=2 et
|
||||
|
77226
tests/dspacestatistics.sql
Normal file
77226
tests/dspacestatistics.sql
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user