I constantly see github js repos with build status notifications (like here). It would make sense if it was a compiled project like java or c++ but it’s javascript, worse thing that can happen is a thrown exception.
What does build status mean in an interpreted language context?
JavaScript can be used on the server (nodejs) or browser. Either way, in general terms, a build status indicates whether your software (javascript in this case) has passed the build tests that are required in order for your software to work as expected.
TravisCI is the software that deals with running the tests that you the Developer set up in advance: http://about.travis-ci.org/docs/user/getting-started/. TravisCI is integrated into GitHub for free… it is a free service.
The way it works is that you setup a configuration file named
.travis.ymlin your repo’s root directory, and TravisCI will “build” your project – meaning it will run the tests that you’ve setup in advance… such as Unit Tests, checking that your code works with the latest NodeJS version, jQuery version, checking dependencies, and other tasks that are important to your project.These tests/checks can and will run on every new push to your repo, making sure that the new changes to your code haven’t broken your project’s functionality. This kind of automated testing can be very helpful when more than one developer writes code for a project. Think of TravisCI as a project cop that explicitly fails your project when your code hasn’t passed the required tests, and doesn’t have the dependencies it needs. Although there could be other reasons as well.
It seems (to me at least) that TravisCI is used in larger projects in the JS community, but that doesn’t mean that it couldn’t be used for smaller ones either. Personally I’ve never used this service – I’m just aware of it and keeping my eyes open in case I ever need it. Hope this clarifies it a little for you.
UPDATE:
Sure, this is a test too. It tests the project with the two provided NodeJS versions (0.8 & 0.6).
Directly quoted form the TravisCI docs:
You can find specific NodeJS details here: http://about.travis-ci.org/docs/user/languages/javascript-with-nodejs/
And general configuration details are here: http://about.travis-ci.org/docs/user/build-configuration/#.travis.yml-file%3A-what-it-is-and-how-it-is-used
If the developers wanted, they could have added more tests or things to happen that would affect the build status. There are many examples here: http://about.travis-ci.org/docs/user/build-configuration/.
For example one could run Shell scripts that perhaps run your JS file(s) through JSLint, JSHint, Google Closure Compiler, or whatever else. You can also add configuration properties to this
.travis.ymlfile that will send you an email on every build, or connect to one of their DBs – mysql, mongodb, etc.I think a good way to learn more about it is to read the docs. Perhaps Google can find other people’s writings on the subject too. The best way to learn though is to roll up your sleeves up high and give it a try.
I’ll be honest though, half of these things are over my head as well, and I’ve never used it for any of my small-ass projects. Hope it makes more sense now.
UPDATE 2:
Yes it does, and that’s the whole point. If you follow their directions in the docs and create an account, I’m sure you will find answers to all of your questions.
When signing up with TravisCI, a VM will be available and connect/sync with your github repo. If in your
.ymlfile you chose NodeJS as the language, then the VM will have NodeJS installed.If you added a
script:key with a value of ashell script (.sh), then this script will execute. If you know how to develop in shell, then you can do all sort of tests and amazing things. As I said, you could run you file through a Linter, validator, or you can run some other JS files in a headless Browser (PhantomJS). The JS files that run in phantom can be the unit-tests themselves. Here is how it’s done: http://about.travis-ci.org/docs/user/gui-and-headless-browsers/More on unit-testing: http://about.travis-ci.org/docs/user/languages/javascript-with-nodejs/#Default-Test-Script – Just read the section about using
Using Vows.If you want to understand exactly how TravisCI does all these things, then learning Ruby will be a great first step.