Skip to content

Commit

Permalink
npm bump
Browse files Browse the repository at this point in the history
  • Loading branch information
michael pearson committed Sep 22, 2013
1 parent 6281534 commit 4a4c549
Show file tree
Hide file tree
Showing 9 changed files with 749 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#TESTS = tests/*.js tests/managers/*.js tests/models/*.js
TESTS = tests/*.js tests/managers/*.js tests/models/bip.js
TESTS = tests/*.js tests/managers/*.js tests/models/*.js
REPORTER = dot

install:
Expand All @@ -10,6 +9,9 @@ install:
mkdir -p data/cdn/img/pods
./tools/setup.js

test-install:
@NODE_ENV=testing ./tools/setup.js

clean:
rm ./config/*.json

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Requirements

- [Node.js >= 0.10.15](http://nodejs.org) **API and graph resolver**
- [MongoDB Server](http://www.mongodb.org) **data store**
- [RabbitMQ](http://www.rabbitmq.com) **message delivery (multiprocess pipeline)**
- [RabbitMQ](http://www.rabbitmq.com) **message broker**

SMTP Bips are available out of the box with a Haraka plugin. Configs under [bipio-contrib/haraka](https://github.com/bipio-server/bipio-contrib).

Expand Down
15 changes: 8 additions & 7 deletions config/upstart_bip.conf
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
#
# Copy this file to /etc/init/bipio.conf (symlinks won't be honored by upstart)
# Copy this file to /etc/init/bip.conf and fix paths where needed to point
# to your local installation
#
# then to start and stop :
# start bipio
# stop bipio
# start bip
# stop bip
#
description "bipio Production Startup Monitor"
description "bip Startup Monitor"
author "michael pearson"

start on startup
stop on shutdown
console log
respawn

env APP_PATH="/var/local/www/cloudspark/prod/server/src"
env LOGFILE="/var/local/www/cloudspark/prod/server/logs/server.log"
env APP_PATH="/path/to/bipio/src"
env LOGFILE="/path/to/bipio/logs/server.log"
env PIDFILE="/var/run/bip.pid"
env USER=bdeploy
env NODE_ENV="production"

script
export HOME="/var/local/www/cloudspark/prod/server"
export HOME="/path/to/bipio/"

echo $$ > $PIDFILE
chdir $HOME
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Michael Pearson (http://www.cloudspark.com.au)",
"name": "bipio",
"version": "0.0.9",
"version": "0.1.0",
"scripts": {

"start": "supervisor src/server.js"
Expand Down
93 changes: 93 additions & 0 deletions tests/managers/dao.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
var bootstrap = require(__dirname + '/../../src/bootstrap'),
dao = bootstrap.app.dao,
assert = require('assert'),
should = require('should'),
uuid = require('node-uuid'),
accountInfo;

describe('bootstrap', function() {
it('can bootstrap', function(done) {
this.timeout(0);
dao.on('ready', function() {
done();
});
});

it('has queues', function(done) {
this.timeout(0);
bootstrap.app.bastion.on('readyQueue', function(queueName) {
if ('queue_jobs' === queueName) {
done();
}
});
});

it('can compile an accountInfo object', function(done) {
dao.checkAuth(
GLOBAL.CFG.testing_user.username,
GLOBAL.CFG.testing_user.password,
'token',
function(err, acct) {
if (err) {
done(err);
} else {
acct.should.be.ok;
acct.user.username.should.equal(GLOBAL.CFG.testing_user.username);

// assert expected object structure and interface
acct.should.have.ownProperty('user');
acct.user.should.have.ownProperty('id');
acct.user.settings.should.be.a('object');

acct.user.domains.should.be.a('object');
acct.user.domains.set.should.be.a('function');
acct.user.domains.get.should.be.a('function');
acct.user.domains.test.should.be.a('function');

acct.user.channels.should.be.a('object');
acct.user.channels.set.should.be.a('function');
acct.user.channels.get.should.be.a('function');
acct.user.channels.test.should.be.a('function');

Object.keys(acct.user.domains).should.not.be.empty;

accountInfo = acct;
done();
}
}
);
});
});


/*
describe('bips', function() {
it('can save a bip', function(done) {
this.timeout(0);
var bip = {
type : 'http',
hub : {
source : {
// edges : [ cid ]
edges : [ '88013839-3932-4083-ae67-fb02f3f32b92' ]
}
}
},
model = dao.modelFactory('bip', bip, accountInfo, true);
dao.create(model, function(err, result) {
console.log(err);
console.log(result);
done(!err && result);
}, accountInfo);
});
});
*/
describe('retrieve a pod', function() {
it('contains expected attributes', function(done) {
dao.pod('facebook').should.have.ownProperty('_description');
dao.pod('facebook').should.have.ownProperty('_description');
done();
});
});
Loading

0 comments on commit 4a4c549

Please sign in to comment.