Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/task-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ function taskRunnerFactory(
'Error checking out task'))
.filter(function(data) { return !_.isEmpty(data);})
.flatMap(self.safeStream.bind(self, store.getTaskById, 'Error fetching task data'))
.filter(function(data) { return !_.isEmpty(data);})
.flatMap(self.runTask.bind(self));
};

Expand Down
12 changes: 12 additions & 0 deletions spec/lib/task-runner-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,18 @@ describe("Task Runner", function() {
});
});

it('should filter when graph not found', function(done) {
runner.running = true;
var taskStream = runner.createRunTaskSubscription(Rx.Observable.just(taskAndGraphId));
store.getTaskById.resolves(undefined);

streamOnCompletedWrapper(taskStream, done, function() {
expect(store.checkoutTask).to.have.been.calledOnce;
expect(store.getTaskById).to.have.been.calledOnce;
expect(runner.runTask).to.not.have.been.called;
});
});

it('should run a task', function(done) {
runner.running = true;
this.sandbox.stub(runner, 'handleStreamSuccess');
Expand Down