From a2aff9a86032d82463af51fdabc87237196de918 Mon Sep 17 00:00:00 2001 From: brantje Date: Sat, 8 Oct 2016 16:30:30 +0200 Subject: [PATCH 1/4] Try to fix phpunit test at travis --- .travis.yml | 2 +- tests/bootstrap.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0506795..329fc314 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ script: - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '2' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi" - cd apps/$APP_NAME/ - #- php build/phpunit.phar -c phpunit.xml + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -c phpunit.xml; fi" # Create coverage report #- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 995df9a2..f6c58443 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,4 +10,17 @@ */ require_once __DIR__ . '/../../../tests/bootstrap.php'; -require_once __DIR__ . '/../appinfo/autoload.php'; \ No newline at end of file +require_once __DIR__ . '/../appinfo/autoload.php'; + + + +// Fix for "Autoload path not allowed: .../tests/lib/testcase.php" +\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests'); +// Fix for "Autoload path not allowed: .../activity/tests/testcase.php" +\OC_App::loadApp('activity'); +// Fix for "Autoload path not allowed: .../files/lib/activity.php" +\OC_App::loadApp('files'); +// Fix for "Autoload path not allowed: .../files_sharing/lib/activity.php" +\OC_App::loadApp('files_sharing'); + +OC_Hook::clear(); \ No newline at end of file From 0958c24d516ae73151c8ad2af7883c3f0b75c86b Mon Sep 17 00:00:00 2001 From: brantje Date: Sat, 8 Oct 2016 16:35:29 +0200 Subject: [PATCH 2/4] Add code-coverage --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 329fc314..ea07aab1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,11 +63,11 @@ script: - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '2' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi" - cd apps/$APP_NAME/ - - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -c phpunit.xml; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -c phpunit.xml --coverage-clover clover.xml; fi" # Create coverage report - #- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" - #- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi" #- cd ../ - sh -c "if [ '$JSTESTS' = '1' ]; then grunt jshint; fi" From 1e081999c7c6d56bbe354e9677bfa13252d005ad Mon Sep 17 00:00:00 2001 From: brantje Date: Sat, 8 Oct 2016 17:33:32 +0200 Subject: [PATCH 3/4] Add drone config --- .drone.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .drone.yaml diff --git a/.drone.yaml b/.drone.yaml new file mode 100644 index 00000000..4f29936b --- /dev/null +++ b/.drone.yaml @@ -0,0 +1,21 @@ +pipeline: + clone: + image: plugins/git + depth: 1 + signed-off-check: + image: nextcloudci/php7.0:php7.0-2 + environment: + - APP_NAME=passman + - CORE_BRANCH=master + - DB=sqlite + commands: + - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh + - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB + - cd ../server + - php ./build/signed-off-checker.php + when: + matrix: + TESTS: signed-off-check +matrix: + include: + - TESTS: signed-off-check From a9eda2f0dcf883b9757d028b54fe0a91db3a75b9 Mon Sep 17 00:00:00 2001 From: brantje Date: Sun, 9 Oct 2016 13:29:05 +0200 Subject: [PATCH 4/4] Add code coverag --- .scrutinizer.yml | 6 ++++++ .travis.yml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 00000000..a0b592f6 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,6 @@ +tools: + external_code_coverage: true + php_mess_detector: true + php_code_sniffer: true + sensiolabs_security_checker: true + php_code_coverage: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index ea07aab1..573b27fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,11 +63,11 @@ script: - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '2' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi" - cd apps/$APP_NAME/ - - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -c phpunit.xml --coverage-clover clover.xml; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -c phpunit.xml --coverage-clover=coverage.clover; fi" # Create coverage report - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" - - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi" + - sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi" #- cd ../ - sh -c "if [ '$JSTESTS' = '1' ]; then grunt jshint; fi"