From 070e901dbb531d4948d7ed3d18b5e02021a9a499 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Sat, 10 Dec 2016 14:59:48 +0100 Subject: [PATCH] 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 --- .scrutinizer.yml | 4 ++++ .travis.yml | 6 ++++++ Makefile | 8 ++++---- Tests/Functional/FunctionalTests.xml | 12 ++++++++++++ Tests/Unit/UnitTests.xml | 12 ++++++++++++ 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 7cbd254..56b321e 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -32,3 +32,7 @@ tools: php_analyzer: enabled: true + # We generate code coverage during tests at travis and will send them here + external_code_coverage: + runs: 2 + timeout: 1200 diff --git a/.travis.yml b/.travis.yml index 2cb95f9..84984ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,6 +45,12 @@ install: make install 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: directories: - $HOME/.composer/cache diff --git a/Makefile b/Makefile index fbf1b18..7fe83d5 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,9 @@ typo3DatabasePassword ?= "dev" typo3DatabaseHost ?= "127.0.0.1" .PHONY: install -install: - rm -rf .Build +install: clean COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-source typo3/cms="$(TYPO3_VERSION)" - git checkout composer.json - mkdir -p $(TYPO3_WEB_DIR)/uploads $(TYPO3_WEB_DIR)/typo3temp unitTests: TYPO3_PATH_WEB=$(TYPO3_WEB_DIR) \ @@ -33,3 +30,6 @@ functionalTests: .PHONY: Tests Tests: unitTests functionalTests + +clean: + rm -rf .Build composer.lock diff --git a/Tests/Functional/FunctionalTests.xml b/Tests/Functional/FunctionalTests.xml index 466358e..07d6f87 100644 --- a/Tests/Functional/FunctionalTests.xml +++ b/Tests/Functional/FunctionalTests.xml @@ -19,4 +19,16 @@ . + + + + ../../Classes + + + + + + + + diff --git a/Tests/Unit/UnitTests.xml b/Tests/Unit/UnitTests.xml index 93247f4..63627f9 100644 --- a/Tests/Unit/UnitTests.xml +++ b/Tests/Unit/UnitTests.xml @@ -19,4 +19,16 @@ . + + + + ../../Classes + + + + + + + +