FEATURE: Add code coverage for tests to travis and scrutinizer (#6)

* FEATURE: Add code coverage for tests to travis and scrutinizer

* To detect which parts still need to be tested

* BUGFIX: Fix broken TYPO3 installation for tests

* We need the source, otherwise a base test file will be missing
This commit is contained in:
Daniel Siepmann 2016-12-10 14:59:48 +01:00 committed by GitHub
parent 67463fa135
commit 070e901dbb
5 changed files with 38 additions and 4 deletions

View file

@ -32,3 +32,7 @@ tools:
php_analyzer: php_analyzer:
enabled: true enabled: true
# We generate code coverage during tests at travis and will send them here
external_code_coverage:
runs: 2
timeout: 1200

View file

@ -45,6 +45,12 @@ install: make install
script: make Tests script: make Tests
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover .Build/report/unit/clover/coverage
- php ocular.phar code-coverage:upload --format=php-clover .Build/report/functional/clover/coverage
- make clean
cache: cache:
directories: directories:
- $HOME/.composer/cache - $HOME/.composer/cache

View file

@ -10,12 +10,9 @@ typo3DatabasePassword ?= "dev"
typo3DatabaseHost ?= "127.0.0.1" typo3DatabaseHost ?= "127.0.0.1"
.PHONY: install .PHONY: install
install: install: clean
rm -rf .Build
COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-source typo3/cms="$(TYPO3_VERSION)" COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-source typo3/cms="$(TYPO3_VERSION)"
git checkout composer.json git checkout composer.json
mkdir -p $(TYPO3_WEB_DIR)/uploads $(TYPO3_WEB_DIR)/typo3temp
unitTests: unitTests:
TYPO3_PATH_WEB=$(TYPO3_WEB_DIR) \ TYPO3_PATH_WEB=$(TYPO3_WEB_DIR) \
@ -33,3 +30,6 @@ functionalTests:
.PHONY: Tests .PHONY: Tests
Tests: unitTests functionalTests Tests: unitTests functionalTests
clean:
rm -rf .Build composer.lock

View file

@ -19,4 +19,16 @@
<directory>.</directory> <directory>.</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../Classes</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="../../.Build/report/unit/html" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="../../.Build/report/unit/clover/coverage"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
</logging>
</phpunit> </phpunit>

View file

@ -19,4 +19,16 @@
<directory>.</directory> <directory>.</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../Classes</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="../../.Build/report/functional/html" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="../../.Build/report/functional/clover/coverage"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
</logging>
</phpunit> </phpunit>