Meteor Continuous Integration & Deployment - Bitbucket to Digital Ocean

Source code for the meteor application is in a private repository in bitbucket. It is deployed as a dockerised node application in Digital Ocean. Master branch is used for staging and the release branch is used for production. Whenever there is a change in the master branch, velocity tests are to run if it all works, it is to be deployed.

Following link details how it is done using wercker and tutum.
Sample code and the steps explained in a blog
It uses a base velocity test docker image, phantomjs was giving some weird errors initially. All said, it is all working so smoothly. Thought of posting this out as it could be of help to someone with similar scenarios.

Now, to experts in velocity -
As of now, as I understand, there is no ‘unit test’ mode for packages in velocity. If there is a way to do it, can somebody point it out to me. Also, how to get a coverage report and test report persisted using velocity, I don’t find an out of the box solution for it in velocity.Any inputs?

1 Like

[quote=“lucidprogrammer, post:1, topic:14885”]
there is no ‘unit test’ mode for packages in velocity[/quote]

By unit-testing, do you mean without Meteor/Velocity loading at all? If so, then the answer is it’s not easily possible. You’d have to write stubs for all the Meteor methods. We used to do this so you can try and pick this up where we left off.

You can use Istanbul to do it. First you instrument the files prior to the Meteor app running, then you make sure to post back any client reports before page unloads and when the tests finish. You then combine the client fragments along with the server coverage report and you have a coverage report.

You can write your own reporter. The reports all go to a collection so you can write your own and get it to write to file. See the console reporter for a simple reference implementation

1 Like