diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9909f21..49a188f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ image: node:6 services: - mongo + - redis stages: - test @@ -14,6 +15,10 @@ test: - npm test tags: - docker + variables: + MONGO_URL: "mongodb://mongo:27017/hostr" + REDIS_URL: "redis://redis:6379" + DEBUG: "hostr*" cache: key: "$CI_BUILD_REF_NAME" diff --git a/test/fixtures/mongo-file.js b/test/fixtures/mongo-file.js index 4616bf0..3d11f11 100644 --- a/test/fixtures/mongo-file.js +++ b/test/fixtures/mongo-file.js @@ -1,7 +1,6 @@ const MongoClient = require('mongodb').MongoClient; -const url = 'mongodb://localhost:27017/hostr'; -MongoClient.connect(url, function connect(err, db) { +MongoClient.connect(process.env.MONGO_URL, function connect(err, db) { const collection = db.collection('files'); collection.createIndex({ 'owner': 1, diff --git a/test/fixtures/mongo-user.js b/test/fixtures/mongo-user.js index 01d5e42..14334e2 100644 --- a/test/fixtures/mongo-user.js +++ b/test/fixtures/mongo-user.js @@ -1,7 +1,6 @@ const MongoClient = require('mongodb').MongoClient; -const url = 'mongodb://localhost:27017/hostr'; -MongoClient.connect(url, function connect(err, db) { +MongoClient.connect(process.env.MONGO_URL, function connect(err, db) { const collection = db.collection('users'); collection.remove({ 'email': 'test@hostr.co',