Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no route for the path: /local #16

Closed
rws-github opened this issue Sep 6, 2016 · 13 comments
Closed

There is no route for the path: /local #16

rws-github opened this issue Sep 6, 2016 · 13 comments
Labels

Comments

@rws-github
Copy link

rws-github commented Sep 6, 2016

Existing tests that run in
meteor test --once --driver-package dispatch:mocha-phantomjs
do not run with
spacejam test --driver-package practicalmeteor:mocha-console-runner --coverage out_coverage

Expected Behavior

Existing tests to run

Current Behavior

Ouput indicates its testing a path of /local for no apparent reason:

=> App running at: http://localhost:4096/
spacejam: meteor is ready
spacejam: spawning phantomjs
phantomjs: Running tests at http://localhost:4096/local using test-in-console and coverage
phantomjs: There is no route for the path: /local
    http://localhost:4096/packages/kadira_flow-router.js?hash=09ea12875d3801955ee70797bf8e4a70feebc570: 488
spacejam: phantomjs exited with code: 6
spacejam: killing meteor
spacejam: Unknown error with exit code 'null'. Exiting.
@serut
Copy link
Owner

serut commented Sep 6, 2016

Hello @rws-github .
This error is printed by flow-router because there is no route while testing.
A workaround would be to use this pull request : kadirahq/flow-router#615

cd packages
git submodule add https://github.com/serut/flow-router

This repository uses that system: https://github.com/serut/meteor-coverage-app-exemple and it works great

@serut serut added the question label Sep 6, 2016
@rws-github
Copy link
Author

It now runs the tests. I don't see any coverage being output.

COVERAGE=1 COVERAGE_APP_FOLDER=$(pwd)/ COVERAGE_VERBOSE=1 spacejam test --driver-package practicalmeteor:mocha-console-runner --coverage out_coverage

---------------------RESULTS----------------------
PASSED: 142
FAILED: 1
SKIPPED: 0
TOTAL: 146

.coverage.json has "output": "./.coverage"

Nothing in .coverage after run

@serut
Copy link
Owner

serut commented Sep 7, 2016

I don't have any log to help you. Does the .coverage folder exist ?

@serut
Copy link
Owner

serut commented Sep 23, 2016

Can you retry with the lastest release please ?
Note that you should use --settings instead of envrionment variables

@rws-github
Copy link
Author

I just noticed my version of meteor-coverage is set to 0.8.1 and I get this on update:

rws$ meteor update lmieulet:meteor-coverage
=> Errors while upgrading packages:           

While checking for lmieulet:[email protected]:
error: No compatible binary build found for this package. Contact the package author and ask them to publish it for your platform.

@rws-github
Copy link
Author

Sorry, wrong command. This installed:

meteor add 'lmieulet:meteor-coverage@=1.0.1'

@serut
Copy link
Owner

serut commented Sep 23, 2016

And this is working ? Do you see yours files ?

@rws-github
Copy link
Author

It seems to just start the app normally and not run tests:

 rws$ COVERAGE=1 COVERAGE_APP_FOLDER=$(pwd)/ COVERAGE_VERBOSE=1 meteor test --once --driver-package practicalmeteor:mocha
[[[[[ Tests ]]]]]                             

=> Started proxy.                             
=> Started MongoDB.                           

I20160923-12:59:27.876(-4)? Coverage active   
I20160923-12:59:27.941(-4)? Reading custom configuration
I20160923-12:59:27.942(-4)? [Configuration]  { ignore: 
I20160923-12:59:27.942(-4)?    { clientside: { inapp: [Object], public: [] },
I20160923-12:59:27.942(-4)?      serverside: 
I20160923-12:59:27.943(-4)?       [ 'livedata.js',
I20160923-12:59:27.943(-4)?         'hot-code-push.js',
I20160923-12:59:27.943(-4)?         'launch-screen.js',
I20160923-12:59:27.943(-4)?         'templating.js',
I20160923-12:59:27.944(-4)?         'autoupdate.js',
I20160923-12:59:27.944(-4)?         'reload.js',
I20160923-12:59:27.944(-4)?         'global-imports.js',
I20160923-12:59:27.944(-4)?         'server/fixtures/test_helper.js' ] } }
I20160923-12:59:27.945(-4)? Loading default configuration: exclude.*
I20160923-12:59:27.945(-4)? Loading default configuration: include
I20160923-12:59:27.945(-4)? Loading default configuration: output
I20160923-12:59:27.946(-4)? Loading default configuration: remapFormat
I20160923-12:59:27.946(-4)? Coverage configuration:
I20160923-12:59:27.946(-4)? - IS_COVERAGE_ACTIVE= true
I20160923-12:59:27.946(-4)? - IS_COVERAGE_VERBOSE= true
I20160923-12:59:27.947(-4)? - COVERAGE_APP_FOLDER= /Users/rws/uc_cloud_workspace/continuous-release-ui/
I20160923-12:59:27.947(-4)? .coverage.json values:
I20160923-12:59:27.947(-4)? - exclude= { general: [],
I20160923-12:59:27.948(-4)?   server: 
I20160923-12:59:27.948(-4)?    [ '**/node_modules/**/*.json',
I20160923-12:59:27.949(-4)?      '**/.?*/**',
I20160923-12:59:27.949(-4)?      '**/packages/!(local-test_?*.js)',
I20160923-12:59:27.949(-4)?      '**/+([^:]):+([^:])/**',
I20160923-12:59:27.950(-4)?      '**/@(test|tests|spec|specs)/**',
I20160923-12:59:27.950(-4)?      '**/?(*.)test?(s).?*',
I20160923-12:59:27.950(-4)?      '**/?(*.)spec?(s).?*',
I20160923-12:59:27.950(-4)?      '**/?(*.)app-test?(s).?*',
I20160923-12:59:27.951(-4)?      '**/?(*.)app-spec?(s).?*' ],
I20160923-12:59:27.951(-4)?   client: 
I20160923-12:59:27.951(-4)?    [ '**/client/stylesheets/**',
I20160923-12:59:27.951(-4)?      '**/.npm/package/node_modules/**',
I20160923-12:59:27.951(-4)?      '**/web.browser/packages/**',
I20160923-12:59:27.952(-4)?      '**/.?*/**',
I20160923-12:59:27.952(-4)?      '**/packages/!(local-test_?*.js)',
I20160923-12:59:27.953(-4)?      '**/+([^:]):+([^:])/**',
I20160923-12:59:27.953(-4)?      '**/@(test|tests|spec|specs)/**',
I20160923-12:59:27.953(-4)?      '**/?(*.)test?(s).?*',
I20160923-12:59:27.953(-4)?      '**/?(*.)spec?(s).?*',
I20160923-12:59:27.953(-4)?      '**/?(*.)app-test?(s).?*',
I20160923-12:59:27.954(-4)?      '**/?(*.)app-spec?(s).?*' ] }
I20160923-12:59:27.954(-4)? - include= []
I20160923-12:59:27.954(-4)? - remapFormat= [ 'html',
I20160923-12:59:27.954(-4)?   'cobertura',
I20160923-12:59:27.954(-4)?   'clover',
I20160923-12:59:27.955(-4)?   'json',
I20160923-12:59:27.955(-4)?   'json-summary',
I20160923-12:59:27.955(-4)?   'lcovonly',
I20160923-12:59:27.955(-4)?   'teamcity',
I20160923-12:59:27.955(-4)?   'text',
I20160923-12:59:27.955(-4)?   'text-summary' ]
I20160923-12:59:27.956(-4)? - COVERAGE_EXPORT_FOLDER= ./.coverage
I20160923-12:59:28.749(-4)? [Ignored][exclude.server]:  /packages/tmeasday_test-reporter-helpers.js
I20160923-12:59:28.750(-4)? [ServerSide][Package] file ignored: /packages/tmeasday_test-reporter-helpers.js
I20160923-12:59:28.750(-4)? [Ignored][exclude.server]:  /packages/reload.js
I20160923-12:59:28.750(-4)? [ServerSide][Package] file ignored: /packages/reload.js
I20160923-12:59:28.752(-4)? [Ignored][exclude.server]:  /packages/autoupdate.js
I20160923-12:59:28.752(-4)? [ServerSide][Package] file ignored: /packages/autoupdate.js
I20160923-12:59:28.753(-4)? [Ignored][exclude.server]:  /packages/practicalmeteor_loglevel.js
I20160923-12:59:28.754(-4)? [ServerSide][Package] file ignored: /packages/practicalmeteor_loglevel.js
I20160923-12:59:28.757(-4)? [Ignored][exclude.server]:  /packages/practicalmeteor_sinon.js
I20160923-12:59:28.759(-4)? [ServerSide][Package] file ignored: /packages/practicalmeteor_sinon.js
I20160923-12:59:28.798(-4)? [Ignored][exclude.server]:  /packages/practicalmeteor_mocha.js
I20160923-12:59:28.799(-4)? [ServerSide][Package] file ignored: /packages/practicalmeteor_mocha.js
I20160923-12:59:28.889(-4)? [Ignored][exclude.server]:  /packages/livedata.js
I20160923-12:59:28.889(-4)? [ServerSide][Package] file ignored: /packages/livedata.js
I20160923-12:59:28.891(-4)? [Ignored][exclude.server]:  /packages/hot-code-push.js
I20160923-12:59:28.891(-4)? [ServerSide][Package] file ignored: /packages/hot-code-push.js
I20160923-12:59:28.891(-4)? [Ignored][exclude.server]:  /packages/launch-screen.js
I20160923-12:59:28.891(-4)? [ServerSide][Package] file ignored: /packages/launch-screen.js
I20160923-12:59:28.894(-4)? [Ignored][exclude.server]:  /packages/templating.js
I20160923-12:59:28.894(-4)? [ServerSide][Package] file ignored: /packages/templating.js
I20160923-12:59:28.894(-4)? [Ignored][exclude.server]:  /packages/react-runtime.js
I20160923-12:59:28.895(-4)? [ServerSide][Package] file ignored: /packages/react-runtime.js
I20160923-12:59:29.057(-4)? [Ignored][exclude.server]:  /packages/global-imports.js
I20160923-12:59:29.057(-4)? [ServerSide][Package] file ignored: /packages/global-imports.js
I20160923-12:59:29.076(-4)? [Ignored][exclude.server]:  /private/var/folders/zq/yxg2g37j6xg9d598ltzwycsw0000gn/T/meteor-test-run1xygkqi/.meteor/local/build/programs/server/app/app.js
I20160923-12:59:29.077(-4)? [ServerSide][App.js] file ignored: /app/app.js
I20160923-12:59:30.398(-4)? [Ignored][exclude.server]:  /packages/mdg_validation-error.js
I20160923-12:59:30.399(-4)? [ServerSide][Package] file ignored: /packages/mdg_validation-error.js
=> Started your app.

=> App running at: http://localhost:3000/

@serut
Copy link
Owner

serut commented Sep 23, 2016

You need to replace mocha to mocha-console-runner

@rws-github
Copy link
Author

It did the same thing.

If I run:
COVERAGE=1 COVERAGE_APP_FOLDER=$(pwd)/ COVERAGE_VERBOSE=1 meteor test --once --driver-package dispatch:mocha-phantomjs

It prints that it is covering things but I get no output of coverage at the end.

@serut
Copy link
Owner

serut commented Sep 23, 2016

Yeap, you require spacejam to export coverage reports.
Indeed, where Istanbul receives the event your app died correctly and at that moment start to generate reports, meteor-coverage is compiled with your app and cannot know when tests are done. To generate report, you need to send HTTP request manually, or use spacejam to do it automatically
What you have to do:

    "coverage-app-unit": "spacejam-mocha test --coverage 'out_lcovonly out_coverage out_html'",

By the way, It can be run with

    meteor npm run coverage-app-unit

It means:

    spacejam test --coverage 'out_lcovonly out_coverage out_html' --driver-package practicalmeteor:mocha-console-runner

If you want to start your app and do everything by yourself

    meteor test --driver-package practicalmeteor:mocha [--settings settings.coverage.json or environment variables]
   # Open browser localhost:3000 to let test execute
   # Open browser localhost:3000/coverage to see that server side have been covered
   # Execute the following in the browser console: Meteor.sendCoverage()
   # Open browser localhost:3000/coverage to see that client is there too
   # Now you can generate reports, still using your browser console, with Meteor.exportCoverage(type)
   # You fall asleep, this is too much to do by yourself :/

The readme of the package have been rewritten with everything I'm saying, it will help you a lot, and if not use the meteor-coverage-app-exemple to see how things works.

@rws-github
Copy link
Author

It worked when I ran:

COVERAGE=1 COVERAGE_APP_FOLDER=$(pwd)/ spacejam test --driver-package practicalmeteor:mocha-console-runner --coverage out_coverage

Thanks for your help and project!

@serut
Copy link
Owner

serut commented Sep 23, 2016

You welcome ! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants