A streaming API of job console output #10

Closed
wants to merge 7 commits into
from

Projects

None yet

2 participants

@5long

Hi,

I'm about to implement a simple continuous deployment dashboard integrating with Jenkins and I just stumbled upon nestor. A readable stream would be easier for me to implement a stream -> websocket proxy for browser. Luckily the current implementation is fairly complete and all I have to do is a little refactoring to get this far.

However, this pull request is by no means complete:

  • ConsoleStream doesn't fully implement the readable stream API yet. But currently it works well enough for me.
  • Not sure how to write tests for this :( But I did test it manually for a bit.

Feel free to tell me what more should I do to get this merged.

@5long

I've just setup Travis-CI and it seems that I just broke the build.

Problem is, I can't run tests locally. Here are my steps:

  • npm i to install dependencies of nestor
  • npm i -g bob to install bob
  • bob build to build stuff, but all I got is just lint errors and the tests are not run. Here is what I got from bob build &>/tmp/bob.log: https://gist.github.com/5long/5140255

Any ideas how I can run tests before pushing?

@cliffano
Owner

What's the output of node --version && bob --version ?
I've just tested bob build and it worked fine on master.

The unit tests (in test directory) pretty much mock the console output, so you'll need to look at how you can do the same thing.
Don't worry about integration tests (in test-integration directory), I only run it on my local Jenkins due to its dependency to a running Jenkins CI.

Once you get the build passing, do you mind opening a new pull request with a single commit for these changes? That would be easier to read.

@5long

I was running nodejs v0.8.22 and bob 0.5.16. I just reinstalled bob 0.5.17 and it still fails.

But I also realized that I've got a long abandoned incomplete ~/.jshintrc file on this machine. Removing ~/.jshintrc and now bob build builds just like how it works on Travis.

And yes, it's totally okay for me to squash all commits into a single one. Now I'd go fix those test failures.

@cliffano
Owner

Cool. I've also just added 0.10 and 0.11 to Travis CI run, to make sure everything passes.
https://travis-ci.org/cliffano/nestor/builds/5935345

@5long

I've decided to just port all existing tests of .console() to .consoleStream() since there isn't much stuff to test in .console(). The code is landed in d85d521

@cliffano
Owner

Closing this one, replaced by #11

@cliffano cliffano closed this Apr 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment