Closed mizzao closed 10 years ago
@mizzao nice, didn't realize it was that easy! I'm all for it -- are you OK with making this change? I connected up my GitHub account with Travis, and flipped the switch on the collection-hooks repo. Would you need anything else?
@matb33 Tests are added, but the find/findOne userId tests have some non-deterministic behavior where they may fail on the first page load. It seems like they fail every time when testing in console. I didn't used to care about this because before, re-running the tests would make them pass, but I'm going to figure out how to fix them so that everything passes in Travis.
Need to get rid of that poopy "build failing" badge as soon as possible :)
Nice, if you fix this you'll at least be worthy of a "tinytest master" badge :)
What can I say, I am a tinytest master: https://travis-ci.org/matb33/meteor-collection-hooks
I had to do something very interesting to get the synchronous tests to run with a login: https://github.com/matb33/meteor-collection-hooks/blob/master/tests/find_findone_userid.js#L75. But it was good practice, now I know how to make that work on my other packages too.
For future reference, the commands that need to be run for an automated test, to replicate what the travis package does, are
meteor test-packages --driver-package test-in-console collection-hooks
and then in a different terminal
URL="http://localhost:3000/" phantomjs $METEOR_HOME/packages/test-in-console/runner.js
Awesome @mizzao, made my day!
Hi @matb33,
I just fixed the tests in this package for 0.7.2 in 81248850ac0b61a2e386b6fc50a01cde43b497ec.
Since this package has Tinytest set up, it would be sweet to set up automatic testing. It just requires a few things:
Add the following to the root of the repo as
.travis.yml
:(optional): Add the cool little build badge with this Markdown in the README:
For more information see https://github.com/arunoda/travis-ci-meteor-packages. I have this running for https://github.com/mizzao/meteor-user-status, here: https://travis-ci.org/mizzao/meteor-user-status. The integration is really nice, you get the nice little badge that shows everything is working, and you don't have to
meteor test-packages
yourself!Plus there is the added benefit that tests are run for all pull requests, so if everything passes and it doesn't look kooky, you can just auto merge. Saves a lot of work!