mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-01-12 22:46:42 +08:00
merged remote db patch updates
This commit is contained in:
1
test-app/.dpd/deployments.json
Normal file
1
test-app/.dpd/deployments.json
Normal file
@@ -0,0 +1 @@
|
||||
{"test-app.deploydapp.com":{"subdomain":"abcdefg"},"foo":"bar","abcdefg.deploydapp.com":{"remote":"deploydapp.com","path":"/Users/skawful/Dropbox/node_modules/deployd/test-app","name":"abcdefg","subdomain":"abcdefg","user":"ritch"},"ritch.deploydapp.com":{"remote":"deploydapp.com","path":"/Users/skawful/Dropbox/node_modules/deployd/test-app","name":"ritch","subdomain":"ritch","user":"test-app"}}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"warning": "This test is going to wipe your db, don't use a production machine",
|
||||
"you've": "been warned...",
|
||||
"host": "foo.com",
|
||||
"port": 27017,
|
||||
"name": "test-collection",
|
||||
"credentials": {
|
||||
"username": "foo",
|
||||
"password": "secret"
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,15 @@
|
||||
var fs = require('fs')
|
||||
, db = require('../lib/db')
|
||||
, configContents = fs.readFileSync('db-remote.config.json','utf8')
|
||||
, config = JSON.parse(configContents)
|
||||
, config = require(__dirname + '/support/db-remote.config.json')
|
||||
, tester = db.create(config)
|
||||
, store = tester.createStore('test-store')
|
||||
, Store = require('../lib/db').Store
|
||||
, assert = require('assert')
|
||||
;
|
||||
|
||||
if (config.host == 'foo.com') {
|
||||
console.warn('Before you run db-remote.unit.js tests, set up the configuration in "db-remote.config.json".')
|
||||
return;
|
||||
}
|
||||
, cp = require('child_process');
|
||||
|
||||
before(function (done) {
|
||||
var cmd = "mongo " + config.name + " --eval 'db.system.users.remove({}); db.addUser(\"" + config.credentials.username + "\", \"" + config.credentials.password + "\");'";
|
||||
cp.exec(cmd, done);
|
||||
});
|
||||
|
||||
beforeEach(function(done){
|
||||
store.remove(function () {
|
||||
|
||||
9
test/support/db-remote.config.json
Normal file
9
test/support/db-remote.config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"host": "127.0.0.1",
|
||||
"port": 27017,
|
||||
"name": "dpd-faux-remote",
|
||||
"credentials": {
|
||||
"username": "foo",
|
||||
"password": "secret"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user