Skip to content

Commit

Permalink
Enables pushed app before starting
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyman727 committed Jun 2, 2016
1 parent 9d88920 commit b63ec46
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions lib/tessel/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,13 @@ exportables.createShellScript = function(tessel, opts) {
exportables.start = function(tessel, entryPoint) {
return tessel.simpleExec(commands.moveFolder(Tessel.REMOTE_RUN_PATH, Tessel.REMOTE_PUSH_PATH))
.then(() => {
return tessel.simpleExec(commands.app.start())
return tessel.simpleExec(commands.app.enable())
.then(() => {
logs.info('Running %s...', entryPoint);
return Promise.resolve();
return tessel.simpleExec(commands.app.start())
.then(() => {
logs.info('Running %s...', entryPoint);
return Promise.resolve();
});
});
});
};
Expand Down
7 changes: 5 additions & 2 deletions test/unit/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ exports['Tessel.prototype.deploy'] = {
this.deploy = sandbox.spy(Tessel.prototype, 'deploy');
this.appStop = sandbox.spy(commands.app, 'stop');
this.appStart = sandbox.spy(commands.app, 'start');
this.appEnable = sandbox.spy(commands.app, 'enable');
this.deleteFolder = sandbox.spy(commands, 'deleteFolder');
this.createFolder = sandbox.spy(commands, 'createFolder');
this.untarStdin = sandbox.spy(commands, 'untarStdin');
Expand Down Expand Up @@ -278,7 +279,7 @@ exports['Tessel.prototype.deploy'] = {
},

push: function(test) {
test.expect(11);
test.expect(12);
deployTestCode(this.tessel, {
push: true,
single: false
Expand All @@ -301,14 +302,15 @@ exports['Tessel.prototype.deploy'] = {
test.equal(this.execute.callCount, 0);
test.equal(this.openStdinToFile.callCount, 1);
test.equal(this.chmod.callCount, 1);
test.equal(this.appEnable.callCount, 1);
test.equal(this.appStart.callCount, 1);
test.equal(this.end.callCount, 1);
test.done();
});
},

pushSingle: function(test) {
test.expect(9);
test.expect(10);
deployTestCode(this.tessel, {
push: true,
single: true
Expand All @@ -325,6 +327,7 @@ exports['Tessel.prototype.deploy'] = {
test.equal(this.openStdinToFile.callCount, 1);
test.equal(this.chmod.callCount, 1);
test.equal(this.appStart.callCount, 1);
test.equal(this.appEnable.callCount, 1);
test.equal(this.end.callCount, 1);
test.done();
});
Expand Down

0 comments on commit b63ec46

Please sign in to comment.