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

No info about travis addon #53

Closed
antonmarin opened this issue Jun 5, 2016 · 9 comments
Closed

No info about travis addon #53

antonmarin opened this issue Jun 5, 2016 · 9 comments

Comments

@antonmarin
Copy link

antonmarin commented Jun 5, 2016

No info about how to configure travis addon to use custom coverage-report file
(test-reporter [--coverage-report COVERAGE-REPORT])

For example:

addons:
    code_climate:
        repo_token: ****
        coverage_report: tests/logs/clover.xml
@1ma
Copy link
Contributor

1ma commented Jun 7, 2016

👍 I agree with that. It'd also be great to document how to leverage the Travis-CI environment variables so you don't need to put your secret token inside the Git repository (this is especially troubling in open source projects).

env example

then in .travis.yml:

addons:
  code_climate:
    repo_token: $CODECLIMATE_REPO_TOKEN

@dblandin
Copy link
Contributor

dblandin commented Jun 7, 2016

@antonmarin Agreed that this repo should at least link to TravisCI's documentation for the Code Climate addon.

@1ma As far as I know, you shouldn't have to configure Code Climate as an addon and add the environment variable separately within your TravisCI repo config.

From what I've gathered, the intended behavior of the addon should be to install the correct test reporter automatically given your repo language and set the right env variable from the repo_token config.

Hopefully that's the case using the addon with a php repo, although I did run into an issue recently configuring the addon for a javascript project: codeclimate/javascript-test-reporter#37. I ended up installing the test reporter manually just before sending the report as a workaround.

@pbrisbin
Copy link
Contributor

It looks like we have some Travis-specific docs available here.

In general, our aim is to centralize documentation on docs.codeclimate.com and link to those from succinct project README's -- to avoid duplication and confusion. This project's README hasn't been rewritten in that style yet, but when it is we should include a link to these docs, and that should close this Issue IMO.

@carbontwelve
Copy link

The documentation on the codeclimate is awful with respect to travis-ci usage. I have had a few builds complete after simply adding the following:

addons:
    code_climate:
        repo_token: ***

and I still get an unknown code coverage, with travis-ci logs showing nothing done with regards to codeclimate.

The available documentation doesn't even mention the need to use travis-ci environment variables to keep the key hidden.

@RobertShippey
Copy link

I agree with @carbontwelve - the documentation on setting this up is mystifying. The doc pages seem to circularly link to each other with none of them adding helpful info 😢

@antonmarin
Copy link
Author

I think that covering usage of travis environments on the page is enough to successfully setup

@carbontwelve
Copy link

I couldn't get the code coverage to work with the travis integration, which is likely because some of my tests change the current working directory and therefore phpunit doesn't save the clover xml file where the test-reporter is expecting it (I am still not sure where on my machine it saved the file to, because I can't find it unless I provide an absolute output path.)

I ended up fixing this with the following (which are now only executed once for one version of PHP):

vendor/bin/phpunit --coverage-clover=$TRAVIS_BUILD_DIR/build/logs/clover.xml
vendor/bin/test-reporter

Does the travis-ci integration set an absolute path for --coverage-clover as per my example above? Because sometimes phpunit will not save the output where you expect it to be if you only provide a relative path.

@ghost
Copy link

ghost commented May 16, 2017

Potential root cause: codeclimate/codeclimate#660

@dblandin
Copy link
Contributor

Hey @antonmarin,

Thank for the issue. We're winding down development on this PHP-specific reporter.

I'd recommend checking out our new test reporter and migrating to it if you're interested!

https://github.com/codeclimate/test-reporter
https://codeclimate.com/changelog/591c99570d51f6481f001291

It's decoupled from the coverage tool used to generate the report, distributed as a static binary, and has support for parallelized builds. 🎉

We've also worked with Travis CI on an update to their Code Climate documentation which you can find here: https://docs.travis-ci.com/user/code-climate/

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

6 participants