mad-eye / meteor-mocha-web

easily and safely run mocha tests within the Meteor framework
MIT License
145 stars 46 forks source link

[package tests] CI mode not working? #161

Open mcbain opened 9 years ago

mcbain commented 9 years ago
meteor test-packages --velocity --driver-package respondly:test-reporter YOUR:PACKAGE

What is the difference of the mentioned CI mode, to a normal run? Currently it does not stop after execution, nor generating any information usable in a CI system (e.g. xunit output etc).

zimme commented 9 years ago

meteor test-packages --velocity --driver-package velocity:console-reporter ./

rissem commented 9 years ago

The --velocity flag outputs test information (pass/fail) to the terminal. Without this flag, passes and fails are not printed to the terminal console. If it's not stopping after execution that's a bug. Do you have a reproduction repo I could look at?

chmac commented 9 years ago

@rissem I spent some hours on it last night. Ripping out parts of my app to try and pin down an issue. I found a few things.

First, if you only import mike:meteor-moch on the server, the tests will never run, so the process will never exit. I created an example.

I've been through my whole application, and if I load mike:mocha-package on both client and server, but only load the package under test and my test files on the server, the tests properly exit.

It's interesting, because I found a few bugs in my Package.onTest() calls (oh javascript, you and your fussy brackets...), which when fixed, seem to have resolved my CI issues. But, all of my tests were correctly run, and the results correctly reported, without the --velocity flag. It seems like there's some kind of difference between how tests are handled when there's a browser involved and when not.

I'll keep digging, and if I'm able to find a simple reproducible case, I'll post it here. Until we need client side testing, it looks like my issue is resolved for now.