1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

Merge pull request #891 from owncloud/bring-scrutinizer-back

cleanup travis.yml and scrutnizer.yml
This commit is contained in:
Thomas Müller 2015-05-08 22:46:51 +02:00
commit dd569dc8ab
7 changed files with 40 additions and 65 deletions

View File

@ -1,13 +1,3 @@
build_failure_conditions:
#- 'elements.rating(<= D).exists' # No classes/methods with a rating of D or worse
- 'elements.rating(<= D).new.exists' # No new classes/methods with a rating of D or worse
- 'issues.label("coding-style").new.exists' # No new coding style issues allowed
- 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity
- 'project.metric("scrutinizer.quality", < 6)' # Code Quality Rating drops below 6
filter:
excluded_paths:
- 'js/modernizr.custom.js'
@ -24,7 +14,10 @@ imports:
- php
- javascript
tools:
external_code_coverage: true
js_hint:
use_native_config: true

View File

@ -10,23 +10,33 @@ branches:
- /^stable\d*$/
env:
- DB=sqlite
- DB=mysql
# - DB=pgsql
global:
- CORE_BRANCH=master
matrix:
- DB=sqlite
before_install:
- wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh
- bash ./before_install.sh contacts master $DB
# - sudo add-apt-repository -y ppa:chris-lea/node.js
# - sudo apt-get update
# - sudo apt-get -y install nodejs
# - wget https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linux-x86_64.tar.bz2
# - tar xjf phantomjs-1.9.0-linux-x86_64.tar.bz2
# - sudo ln -s $(pwd)/phantomjs-1.9.0-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
- bash ./before_install.sh contacts $CORE_BRANCH $DB
- cd ../core
- php occ app:enable contacts
script:
- sh -c "if [ '$DB' = 'sqlite' ]; then ant test; fi"
- phpunit --configuration tests/phpunit.xml --testsuite unit-tests
- cd apps/contacts
- find . -name \*.php -not -path './l10n/*' -exec php -l "{}" \;
- phpunit --configuration tests/phpunit.xml --testsuite unit-tests --coverage-clover clover.xml
#&& make javascript-tests
# Create coverage report
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi"
matrix:
include:
- php: 5.4
env: DB=mysql
# - php: 5.4
# env: DB=pgsql
allow_failures:
- php: hhvm
fast_finish: true

View File

@ -14,7 +14,7 @@
<carddav>appinfo/remote.php</carddav>
</remote>
<dependencies>
<owncloud min-version="8" />
<owncloud min-version="8.1" max-version="8.1" />
<php min-version="5.4" />
</dependencies>
<ocsid>166044</ocsid>

View File

@ -1,25 +0,0 @@
<project name="owncloud-mail" basedir="." default="test">
<property file="build.properties"/>
<!-- test - Tests if the code syntax is correct and executes phpunit tests -->
<target name="test">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir=".">
<include name="**/*.php" />
<exclude name="vendor/**/*" />
</fileset>
</apply>
<!--<exec executable="phpunit" failonerror="true">-->
<!--<arg value="-c" />-->
<!--<arg path="${build.src.dir}/app/"/>-->
<!--<arg value="- -log-junit" />-->
<!--<arg path="${report.dir}/phpunit.xml"/>-->
<!--<arg value="- -coverage-clover" />-->
<!--<arg path=" ${report.dir}/clover.xml"/>-->
<!--</exec>-->
</target>
</project>

View File

@ -1,12 +1,9 @@
<?php
global $RUNTIME_NOAPPS;
$RUNTIME_NOAPPS = true;
if(!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}
require_once __DIR__.'/../../core/lib/base.php';
require_once __DIR__.'/../../../lib/base.php';
if(!class_exists('PHPUnit_Framework_TestCase')) {
require_once('PHPUnit/Autoload.php');
@ -14,9 +11,10 @@ if(!class_exists('PHPUnit_Framework_TestCase')) {
include_once('lib/testcase.php');
//OC_App::enable('contacts');
OC_Hook::clear();
OC_Log::$enabled = true;
\OCP\Util::connectHook('OCA\Contacts', 'pre_deleteContact', '\OCA\Contacts\Hooks', 'contactDeletion');
\Sabre\VObject\Component\VCard::$componentMap['VCARD'] = '\OCA\Contacts\VObject\VCard';
\Sabre\VObject\Component\VCard::$propertyMap['CATEGORIES'] = '\OCA\Contacts\VObject\GroupProperty';

View File

@ -13,29 +13,29 @@ class Test_VObjects extends \OCA\Contacts\TestCase {
}
public function testCrappyVCard() {
$carddata = file_get_contents(__DIR__ . '/../data/test3.vcf');
$cardData = file_get_contents(__DIR__ . '/../data/test3.vcf');
$obj = \Sabre\VObject\Reader::read(
$carddata,
$cardData,
\Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES
);
$obj->validate($obj::REPAIR|$obj::UPGRADE);
$obj->validate($obj::REPAIR);
$this->assertEquals('3.0', (string)$obj->VERSION);
$this->assertEquals('2.1', (string)$obj->VERSION);
$this->assertEquals('Adèle Fermée', (string)$obj->FN);
$this->assertEquals('Fermée;Adèle;;;', (string)$obj->N);
}
public function testEscapedParameters() {
$carddata = file_get_contents(__DIR__ . '/../data/test6.vcf');
$cardData = file_get_contents(__DIR__ . '/../data/test6.vcf');
$obj = \Sabre\VObject\Reader::read(
$carddata,
$cardData,
\Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES
);
$obj->validate($obj::REPAIR|$obj::UPGRADE);
$obj->validate($obj::REPAIR);
$this->assertEquals('3.0', (string)$obj->VERSION);
$this->assertEquals('Parameters;Escaped;;;', (string)$obj->N);
$this->assertEquals('TEL;TYPE=PREF;TYPE=WORK;TYPE=VOICE:123456789' . "\r\n", $obj->TEL->serialize());
$this->assertEquals('TEL;TYPE=PREF\,WORK\,VOICE:123456789' . "\r\n", $obj->TEL->serialize());
}
public function testGroupProperty() {

View File

@ -3,7 +3,6 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
strict="true"
verbose="true"
colors="true"
>