Closed markguinn closed 8 years ago
I ran into the same problem, as the code coverage tools need the git repo in order to ascertain which commit and which branch the coverage belongs to. The original git checkout is still available, and can be found at ~/build/$TRAVIS_REPO_SLUG
. The following example uploads coverage when an environment variable called COVERAGE
is set to 1.
after_script:
- "if [ \"$COVERAGE\" = \"1\" ]; then mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/; fi"
- cd ~/build/$TRAVIS_REPO_SLUG
- wget https://scrutinizer-ci.com/ocular.phar
- "if [ \"$COVERAGE\" = \"1\" ]; then travis_retry codecov && travis_retry php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi"
Could the issue be this line?
https://github.com/silverstripe-labs/silverstripe-travis-support/blob/master/travis_setup.php#L134
So the change you've made is to include the .git archive within the tar when composer does the install?
Yes, that's right. Before it was getting left out of the tar, so after that it wouldn't have mattered what composer did. :P
I'm not sure why but it looks like the module under test ends up without a .git folder, which makes it difficult to use code coverage upload tools, particularly Scrutinizer's Ocular tool. Here's an example: https://travis-ci.org/burnbright/silverstripe-shop/jobs/88189323