Skip to content

Commit

Permalink
refactor-[Test DB]: switch test database to postgres (#40)
Browse files Browse the repository at this point in the history
- Change test DB to a PostgreSQL database to accomodate for new use cases
- Provision PostgreSQL service for TravisCI
  • Loading branch information
chialuka authored and dinobi committed Aug 14, 2019
1 parent 2c7f554 commit 8ca8488
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORT=8080
DB_URL_DEV=postgres://rambo:rambo@localhost:2800/haven
DB_URL_PRODUCTION=postgres://authors:haven@localhost:2800/haven
DATABASE_URL=postgres://authors:haven@localhost:2800/haven
NODE_ENV=development
BASE_URL=/api/v5
JWT_KEY=passkey
Expand All @@ -18,3 +18,5 @@ SENDGRID_API_KEY=gjkijsjdkhfjkshfhfsjh
CLOUD_NAME=teamrambo
CLOUD_API_KEY=rambo
CLOUD_API_SECRET=rambo
DB_URL_TEST=postgres://rambo:rambo@localhost:2800/haven
SERVER_URL=http://localhost:9000
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ cache:
directories:
- node_modules

services:
- postgresql

before_script:
- psql -c 'create database ah_rambo_test;' -U postgres

script:
- npm test

Expand Down
4 changes: 2 additions & 2 deletions server/database/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const development = {
};

const test = {
storage: ':memory',
dialect: 'sqlite'
use_env_variable: 'DB_URL_TEST',
dialect: 'postgres'
};

const production = {
Expand Down

0 comments on commit 8ca8488

Please sign in to comment.