mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-31 20:52:17 +01:00
Merge pull request #891 from owncloud/bring-scrutinizer-back
cleanup travis.yml and scrutnizer.yml
This commit is contained in:
commit
dd569dc8ab
@ -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:
|
filter:
|
||||||
excluded_paths:
|
excluded_paths:
|
||||||
- 'js/modernizr.custom.js'
|
- 'js/modernizr.custom.js'
|
||||||
@ -24,7 +14,10 @@ imports:
|
|||||||
- php
|
- php
|
||||||
- javascript
|
- javascript
|
||||||
|
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
|
external_code_coverage: true
|
||||||
|
|
||||||
js_hint:
|
js_hint:
|
||||||
use_native_config: true
|
use_native_config: true
|
||||||
|
|
||||||
|
38
.travis.yml
38
.travis.yml
@ -10,23 +10,33 @@ branches:
|
|||||||
- /^stable\d*$/
|
- /^stable\d*$/
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- DB=sqlite
|
global:
|
||||||
- DB=mysql
|
- CORE_BRANCH=master
|
||||||
# - DB=pgsql
|
matrix:
|
||||||
|
- DB=sqlite
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh
|
- wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh
|
||||||
- bash ./before_install.sh contacts master $DB
|
- bash ./before_install.sh contacts $CORE_BRANCH $DB
|
||||||
|
- cd ../core
|
||||||
# - sudo add-apt-repository -y ppa:chris-lea/node.js
|
- php occ app:enable contacts
|
||||||
# - 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
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sh -c "if [ '$DB' = 'sqlite' ]; then ant test; fi"
|
- cd apps/contacts
|
||||||
- phpunit --configuration tests/phpunit.xml --testsuite unit-tests
|
- 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
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<carddav>appinfo/remote.php</carddav>
|
<carddav>appinfo/remote.php</carddav>
|
||||||
</remote>
|
</remote>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<owncloud min-version="8" />
|
<owncloud min-version="8.1" max-version="8.1" />
|
||||||
<php min-version="5.4" />
|
<php min-version="5.4" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<ocsid>166044</ocsid>
|
<ocsid>166044</ocsid>
|
||||||
|
25
build.xml
25
build.xml
@ -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>
|
|
@ -1,12 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
global $RUNTIME_NOAPPS;
|
|
||||||
$RUNTIME_NOAPPS = true;
|
|
||||||
|
|
||||||
if(!defined('PHPUNIT_RUN')) {
|
if(!defined('PHPUNIT_RUN')) {
|
||||||
define('PHPUNIT_RUN', 1);
|
define('PHPUNIT_RUN', 1);
|
||||||
}
|
}
|
||||||
require_once __DIR__.'/../../core/lib/base.php';
|
require_once __DIR__.'/../../../lib/base.php';
|
||||||
|
|
||||||
if(!class_exists('PHPUnit_Framework_TestCase')) {
|
if(!class_exists('PHPUnit_Framework_TestCase')) {
|
||||||
require_once('PHPUnit/Autoload.php');
|
require_once('PHPUnit/Autoload.php');
|
||||||
@ -14,9 +11,10 @@ if(!class_exists('PHPUnit_Framework_TestCase')) {
|
|||||||
|
|
||||||
include_once('lib/testcase.php');
|
include_once('lib/testcase.php');
|
||||||
|
|
||||||
//OC_App::enable('contacts');
|
|
||||||
|
|
||||||
OC_Hook::clear();
|
OC_Hook::clear();
|
||||||
OC_Log::$enabled = true;
|
OC_Log::$enabled = true;
|
||||||
\OCP\Util::connectHook('OCA\Contacts', 'pre_deleteContact', '\OCA\Contacts\Hooks', 'contactDeletion');
|
\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';
|
||||||
|
|
||||||
|
@ -13,29 +13,29 @@ class Test_VObjects extends \OCA\Contacts\TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testCrappyVCard() {
|
public function testCrappyVCard() {
|
||||||
$carddata = file_get_contents(__DIR__ . '/../data/test3.vcf');
|
$cardData = file_get_contents(__DIR__ . '/../data/test3.vcf');
|
||||||
$obj = \Sabre\VObject\Reader::read(
|
$obj = \Sabre\VObject\Reader::read(
|
||||||
$carddata,
|
$cardData,
|
||||||
\Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES
|
\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('Adèle Fermée', (string)$obj->FN);
|
||||||
$this->assertEquals('Fermée;Adèle;;;', (string)$obj->N);
|
$this->assertEquals('Fermée;Adèle;;;', (string)$obj->N);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEscapedParameters() {
|
public function testEscapedParameters() {
|
||||||
$carddata = file_get_contents(__DIR__ . '/../data/test6.vcf');
|
$cardData = file_get_contents(__DIR__ . '/../data/test6.vcf');
|
||||||
$obj = \Sabre\VObject\Reader::read(
|
$obj = \Sabre\VObject\Reader::read(
|
||||||
$carddata,
|
$cardData,
|
||||||
\Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES
|
\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('3.0', (string)$obj->VERSION);
|
||||||
$this->assertEquals('Parameters;Escaped;;;', (string)$obj->N);
|
$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() {
|
public function testGroupProperty() {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
convertErrorsToExceptions="true"
|
convertErrorsToExceptions="true"
|
||||||
convertNoticesToExceptions="true"
|
convertNoticesToExceptions="true"
|
||||||
convertWarningsToExceptions="true"
|
convertWarningsToExceptions="true"
|
||||||
strict="true"
|
|
||||||
verbose="true"
|
verbose="true"
|
||||||
colors="true"
|
colors="true"
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user