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

Install Multiple Packages Prior to Testing #25

Closed gordonbanderson closed 8 years ago

gordonbanderson commented 8 years ago

This follows on from https://github.com/silverstripe-labs/silverstripe-travis-support/pull/24 which I've just closed. It allows for extra packages to be installed prior to running tests by adding an extra parameter(s) to the command travis_setup.php command of the form:

  - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require "ezyang/htmlpurifier:4.*,silverstripe/cms:~3.1"

or equivalently

  - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require "ezyang/htmlpurifier:4.* --require silverstripe/cms:~3.1"

Being able to install the extra packages allows for a scenario where a module is tested both with and without an external dependency, for example a module may do different things dependent on whether Translatable is installed or not. External services such as codecov amalgamate coverage from multiple runs, which makes 100% code coverage possible.

I've added badges to the README as per https://github.com/gordonbanderson/silverstripe-travis-support/tree/multiple_require_options but with the paths set for the main branch and repository.

Successful Travis builds with the two different formats for passing extra required packages:

codecov-io commented 8 years ago

Current coverage is 100.00%

Branch #25 has no coverage reports uploaded yet.

No diff could be generated. No reports for master found.

Powered by Codecov. Updated on successful CI builds.

tractorcow commented 8 years ago

I think you're officially a better developer than me now. :P

gordonbanderson commented 8 years ago

CodeCov does lie in that if a file has 0% coverage it is skipped, so in this case it's 100% of 1 PHP file out of 7 :) I haven't investigated why, it may be a PHPUnit configuration issue.

gordonbanderson commented 8 years ago

Oh same issue regarding Scrutinizer badges https://github.com/silverstripe-labs/silverstripe-travis-support - either enable the module under the relevant account in Scrutinizer or remove the badges

tractorcow commented 8 years ago

Setup at https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-travis-support/

gordonbanderson commented 8 years ago

Cool, that one is working but as already mentioned that for the comments is currently not