1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-19 16:54:27 +01:00

initial setup of qa tooling

This commit is contained in:
Thomas Müller 2014-08-19 10:18:07 +02:00
parent 628d201c96
commit 01b977e6ae
6 changed files with 124 additions and 0 deletions

11
.scrutinizer.yml Normal file
View File

@ -0,0 +1,11 @@
filter:
excluded_paths:
- '3rdparty/*'
imports:
- javascript
- php
tools:
external_code_coverage: true

46
.travis.yml Normal file
View File

@ -0,0 +1,46 @@
language: php
php:
- 5.3
- 5.4
- 5.5
env:
global:
- CORE_BRANCH=master
matrix:
- DB=sqlite
branches:
only:
- master
- stable7
before_install:
# - composer install
- wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh
- bash ./before_install.sh bookmarks $CORE_BRANCH $DB
- cd ../core
- php occ app:enable bookmarks
script:
# Test lint
- cd apps/bookmarks
- sh -c "if [ '$DB' = 'sqlite' ]; then ant test; fi"
# Run phpunit tests
- cd tests
- phpunit --configuration phpunit.xml
# Create coverage report
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover clover.xml
matrix:
include:
- php: 5.4
env: DB=mysql
- php: 5.4
env: DB=pgsql
allow_failures:
- php: hhvm
fast_finish: true

25
build.xml Normal file
View File

@ -0,0 +1,25 @@
<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>

15
tests/bootstrap.php Normal file
View File

@ -0,0 +1,15 @@
<?php
global $RUNTIME_NOAPPS;
$RUNTIME_NOAPPS = true;
define('PHPUNIT_RUN', 1);
require_once __DIR__.'/../../../lib/base.php';
if(!class_exists('PHPUnit_Framework_TestCase')) {
require_once('PHPUnit/Autoload.php');
}
OC_Hook::clear();
OC_Log::$enabled = false;

27
tests/phpunit.xml Normal file
View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="bootstrap.php"
strict="true"
verbose="true"
timeoutForSmallTests="900"
timeoutForMediumTests="900"
timeoutForLargeTests="900"
>
<testsuite name='ownCloud - Bookmarks App Tests'>
<directory suffix='test.php'>.</directory>
</testsuite>
<!-- filters for code coverage -->
<filter>
<whitelist>
<directory suffix=".php">../../bookmarks</directory>
<exclude>
<directory suffix=".php">../../bookmarks/l10n</directory>
<directory suffix=".php">../../bookmarks/tests</directory>
</exclude>
</whitelist>
</filter>
<logging>
<!-- and this is where your report will be written -->
<log type="coverage-clover" target="./clover.xml"/>
</logging>
</phpunit>