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

Combine python-coveralls with jest 'collectCoverage' #1123

Closed
jeff1evesque opened this issue May 19, 2018 · 5 comments
Closed

Combine python-coveralls with jest 'collectCoverage' #1123

jeff1evesque opened this issue May 19, 2018 · 5 comments

Comments

@jeff1evesque
Copy link

jeff1evesque commented May 19, 2018

I am implementing python-coveralls (which is successfully being sent to coveralls), with newly added jest coverage. But, I'm not sure how to combine the two into a single result, before being sent to coveralls.io.

Coverage from Jest:

root@browserify:/var/machine-learning# ls -l
total 380
-rw-r--r--  1 root root  84923 May 19 19:43 clover.xml
-rw-r--r--  1 root root 246408 May 19 19:43 coverage-final.json
drwxr-xr-x  4 root root   4096 May 19 19:41 interface
drwxr-xr-x 16 root root   4096 May 19 19:43 lcov-report
-rw-r--r--  1 root root  39877 May 19 19:43 lcov.info
drwxr-xr-x  9 root root   4096 May 19 19:40 src

Note: the full issue can be further reviewed.

@joroshiba
Copy link
Collaborator

@jeff1evesque,

I would recommend reporting the two test suite results separately and using our parrallel builds webhook. You can use the coveralls node module to report the jest coverage. This will report 2 jobs which will be aggregate into to the same build on coveralls. On the coveralls site you would be able to view the total coverage or coverage only from each independent test suite.

The parallel webhook ensures that we don't comment on pull requests until all coverage data has been processed. You can see documentation on it here

Hope this helps!

@jeff1evesque
Copy link
Author

@bytewalls, how do I implement the webhook? I was looking at the documentation you suggested. Do I need to define all three lines:

COVERALLS_PARALLEL=true
https://coveralls.io/webhook?repo_token=(your repo token)
notifications:
  webhooks: https://coveralls.io/webhook?repo_token=COVERALLS_REPO_TOKEN

Specifically, where do I define the first two lines. Can they go into the .coveragerc? Also, is there any difference between (your repo token), and COVERALLS_REPO_TOKEN. Since I version control my .travis.yml, I probably don't want to add my repository token in there.

@joroshiba
Copy link
Collaborator

joroshiba commented May 22, 2018

@jeff1evesque, the second line isn't necessary as the notification webhook part takes care of hitting that endpoint after the build is complete.

As for the repo token, you should set the COVERALLS_REPO_TOKEN as a secret environment variable on travis_ci, and then travis will use it without making it public information as a part of the deploy. The COVERALLS_PARALLEL environment variable you can set in your .travis.yml so that it is restricted to only this branch until merge.

Here is some travis documentation on options of how to set environment variables, which might help.

@jeff1evesque
Copy link
Author

jeff1evesque commented May 23, 2018

Made some additional changes to the .travis.yml:

env:
  - COVERALLS_PARALLEL=true

##
## implement coveralls.io webhook
##
##     https://github.com/lemurheavy/coveralls-public/issues/1123#issuecomment-390699100
##     https://github.com/lemurheavy/coveralls-public/issues/1123#issuecomment-391030777
##
notifications:
  webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN

My builds are failing, and likely a result of poorly defining the corresponding npm run test:coveralls within the docker constructs. But, just wondering if you could confirm whether .travis.yml has properly defined the coveralls implementation.

@jeff1evesque
Copy link
Author

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

No branches or pull requests

2 participants