What is the proper way to get the karma test coverage path into Travis CI?

删除回忆录丶 提交于 2019-12-10 20:24:49

问题


I'm using karma to run unit tests and generate coverage reports. That all works fine but I want to publish the lcov.info file to Code Climate from Travis CI. I've done it before and it works great, but the url from that test runner was static.

The issue is that karma creates a subfolder for each instance it runs such as test/coverage/PhantomJS 1.9.7 (Mac OS X)/lcov.info. Is there a clean way to get that url to feed into travis? I don't want to have to remember to update a hardcoded value every time PhantomJS gets updated. Does anyone know if the .travis.yml file supports something like glob patterns.

Thoughts?


回答1:


A glob pattern will work and I'm using it successfully with a karma/travis/codeclimate set up.

Using

codeclimate < test/coverage/**/lcov.info

should work assuming have the CODECLIMATE_REPO_TOKEN variable set.

Also, options to change the subdirectory structure is being discussed on https://github.com/karma-runner/karma-coverage/pull/62.



来源:https://stackoverflow.com/questions/24537778/what-is-the-proper-way-to-get-the-karma-test-coverage-path-into-travis-ci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!