Skip to content
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.

Add coverage support to spacejam #59

Closed
wants to merge 2 commits into from
Closed

Add coverage support to spacejam #59

wants to merge 2 commits into from

Conversation

serut
Copy link

@serut serut commented May 26, 2016

I worked a lot on spacejam to implement the coverage support using the lmieulet:meteor-coverage package.
The result is not perfect, but it's working at least !
Here is a repository that uses my own fork of spacejam (test, test --full-app, test-package using mocha and test-package using tinytest):
https://github.com/serut/meteor-coverage-app-exemple

Missing feature:

  • merge the coverage between different type of tests.

Things missing to this pull request:

  • Update the readme.md and the help.txt file

@serut
Copy link
Author

serut commented May 31, 2016

Any feeling about this pull request ?

@minid33
Copy link

minid33 commented Jun 28, 2016

+1 :shipit:

There may be some opportunities to break up larger parts of code to make something more testable and add tests.

phantom.exit(0)


checkingStatus = setInterval ->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite a lot of cyclomatic complexity here.

@rbabayoff
Copy link
Member

@serut, once we finish with windows support, we'll take a look at this.

@serut
Copy link
Author

serut commented Jul 15, 2016

I've sometimes dependency injection issues when coverage is active that fails the test when phantomjs opens the page :

phantomjs: TypeError: undefined is not an object (evaluating 'Package['practicalmeteor:chai'].chai')
http://localhost:4096/packages/practicalmeteor_loglevel.js?hash=96cd6887e3b954341d356b2fb1373d3149d292c4: 9

https://travis-ci.org/serut/meteor-coverage-app-exemple/builds/144737808#L4119

phantomjs: TypeError: undefined is not an object (evaluating 'Package['practicalmeteor:loglevel'].loglevel')
http://localhost:4096/packages/practicalmeteor_mocha.js?hash=0c7bae1a756c9691267ec935a8d6a4e081df9cf6: 9

https://travis-ci.org/serut/meteor-coverage-app-exemple/builds/144737808#L6036

Same issue on circle.ci : https://circleci.com/gh/serut/meteor-coverage-app-exemple/30

These errors happens only when the code is intrumented, so I will try to ignore all mocha stuff from instrumentation to see if these errors disappear...!

Also I have another commit that improve functionnalities of spacejam when coverage is launched on that branch : https://github.com/serut/spacejam/tree/windows-suppport-rc4

…e|out_lcovonly" + fix returning code when there is an error on the browser side
@serut
Copy link
Author

serut commented Jul 18, 2016

This commit adds the ability to define what the test runner will do during its test.
Following possibilities are working, and you can mix them to do several task
--coverage in_coverage : import a report.json file which contains the coverage of the app, in order to merge it with the current coverage report
--coverage out_coverage : save the current coverage report in a report.json file
--coverage out_lcovonly : save the current coverage report in a lcov.info file. Such file can be sent to coveralls or codecov easily

So you can do:
--coverage 'in_coverage|out_lcovonly : import a report.json file and save the current coverage report in a lcov.info file ;-) You will see the coverage of 2 types of test on the same report/HMI.

I propose to fork https://github.com/serut/meteor-coverage-app-exemple in the /tests/apps directory , execute all mocha test and check if the report.json and the lcov.info file exist. It would be a nice end-to-end test.

To conclude :

  • We can get app coverage from mocha tests
  • No test yet
  • This pull request refers an old branch
  • Need readme and help.txt improvement

@vangorra
Copy link

I've been using the coverage fork for over a month now. It's working great. What must happen to get this merged?

@serut
Copy link
Author

serut commented Aug 28, 2016

Thanks for testing @vangorra

@serut serut closed this Sep 12, 2016
@serut serut deleted the coverage-support branch September 12, 2016 06:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants