silverstripe / silverstripe-travis-support

Creates a SilverStripe project "around" a module, based on core version constraints and its composer.json definitions
Other
13 stars 16 forks source link

Module ends up without .git folder #21

Closed markguinn closed 8 years ago

markguinn commented 8 years ago

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

gordonbanderson commented 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"
tractorcow commented 8 years ago

Could the issue be this line?

https://github.com/silverstripe-labs/silverstripe-travis-support/blob/master/travis_setup.php#L134

tractorcow commented 8 years ago

Check https://github.com/silverstripe-labs/silverstripe-travis-support/pull/26

gordonbanderson commented 8 years ago

So the change you've made is to include the .git archive within the tar when composer does the install?

tractorcow commented 8 years ago

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