29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-25 23:02:55 +00:00

Switching from Travis to Drone

Removing Hound artifacts
This commit is contained in:
Hannes Papenberg 2020-08-30 21:32:00 +02:00
parent bf2510fdac
commit 82de17c656
8 changed files with 744 additions and 257 deletions

View File

@ -1,108 +1,713 @@
---
kind: pipeline
name: default
name: Codequality
clone:
platform:
os: linux
arch: amd64
steps:
- name: phpcs
image: joomlaprojects/docker-images:phpcs1.5
commands:
- echo $(date)
- /usr/local/vendor/bin/phpcs --report=full --encoding=utf-8 --extensions=php -p --standard=build/phpcs/Joomla .
- echo $(date)
- name: composer
image: joomlaprojects/docker-images:php7.4
commands:
- php -v
- composer install
- composer require phpmd/phpmd
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: restore-cache
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- ./tests/javascript/node_modules
cache_key: [ DRONE_REPO_NAMESPACE, DRONE_REPO_NAME, DRONE_BRANCH, DRONE_STAGE_NUMBER ]
volumes:
- name: cache
path: /cache
- name: phpcs
image: joomlaprojects/docker-images:php7.2
commands:
- php -v
- libraries/vendor/bin/phpcs --report=full --encoding=utf-8 --extensions=php -p --standard=build/phpcs/Joomla .
- name: javascript
image: joomlaprojects/docker-images:systemtests
commands:
- echo $(date)
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
- sleep 3
- fluxbox > /dev/null 2>&1 &
- cd tests/javascript
- npm install
- cd ../..
- tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run
- echo $(date)
- name: javascript
image: joomlaprojects/docker-images:systemtests
commands:
- echo $(date)
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
- sleep 3
- fluxbox > /dev/null 2>&1 &
- cd tests/javascript
- npm install
- cd ../..
- tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run
- echo $(date)
- name: rebuild-cache
image: drillster/drone-volume-cache
settings:
rebuild: true
mount:
- ./tests/javascript/node_modules
cache_key: [ DRONE_REPO_NAMESPACE, DRONE_REPO_NAME, DRONE_BRANCH, DRONE_STAGE_NUMBER ]
volumes:
- name: cache
path: /cache
- name: phpmd
image: joomlaprojects/docker-images:php7.4
commands:
- vendor/bin/phpmd src text cleancode
- vendor/bin/phpmd src text codesize
- vendor/bin/phpmd src text controversial
- vendor/bin/phpmd src text design
- vendor/bin/phpmd src text unusedcode
failure: ignore
- name: analysis3x
image: rips/rips-cli:3.2.2
when:
repo:
- joomla/joomla-cms
- joomla/cms-security
branch:
- staging
commands:
- export RIPS_BASE_URI='https://api.rips.joomla.org'
- rips-cli rips:list --table=scans --parameter filter='{"__and":[{"__lessThan":{"percent":100}}]}'
- rips-cli rips:scan:start --progress --application=1 --threshold=0 --path=$(pwd) --remove-code --remove-upload --tag=$DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; }
environment:
RIPS_EMAIL:
from_secret: RIPS_EMAIL
RIPS_PASSWORD:
from_secret: RIPS_PASSWORD
- name: phpcpd
image: joomlaprojects/docker-images:php7.4
commands:
- phpcpd src
failure: ignore
- name: analysis3x
image: rips/rips-cli:3.2.2
commands:
- export RIPS_BASE_URI='https://api.rips.joomla.org'
- rips-cli rips:list --table=scans --parameter filter='{"__and":[{"__lessThan":{"percent":100}}]}'
- rips-cli rips:scan:start --progress --application=1 --threshold=0 --path=$(pwd) --remove-code --remove-upload --tag=$DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; }
environment:
RIPS_EMAIL:
from_secret: RIPS_EMAIL
RIPS_PASSWORD:
from_secret: RIPS_PASSWORD
when:
branch:
- staging
repo:
- joomla/joomla-cms
- joomla/cms-security
volumes:
- name: cache
- name: composer-cache
host:
path: /tmp/cache
path: /tmp/composer-cache
branches:
exclude: [ l10n_* ]
---
kind: pipeline
name: PHP 5.3
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php5.3
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php5.3
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php5.3
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 5.4
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php5.4
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php5.4
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php5.4
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 5.5
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php5.5
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php5.5
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php5.5
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 5.6
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php5.6
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php5.6
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php5.6
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 7.0
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php7.0
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php7.0
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php7.0
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 7.1
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php7.1
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php7.1
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php7.1
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 7.2
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php7.2
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php7.2
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php7.2
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 7.3
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php7.3
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php7.3
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php7.3
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 7.4
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php7.4
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php7.4
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php7.4
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: PHP 8.0
platform:
os: linux
arch: amd64
steps:
- name: composer
image: joomlaprojects/docker-images:php8.0
commands:
- php -v
- composer install
volumes:
- name: composer-cache
path: /tmp/composer-cache
- name: prepare
image: joomlaprojects/docker-images:php8.0
commands:
- php -v
- sleep 10
- mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql"
- psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql"
- name: PHPUnit
image: joomlaprojects/docker-images:php8.0
commands:
- libraries/vendor/bin/phpunit
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_DATABASE: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_USER: joomla_ut
- name: postgres
image: postgres:11-alpine
environment:
POSTGRES_DB: joomla_ut
POSTGRES_PASSWORD: joomla_ut
POSTGRES_USER: joomla_ut
ports:
- 5432
- name: memcached
image: memcached:alpine
- name: redis
image: redis:alpine
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
---
kind: pipeline
name: package
steps:
- name: packager
image: joomlaprojects/docker-images:packager
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_HOSTNAME: ci.joomla.org
FTP_PORT: "21"
FTP_DEST_DIR: /artifacts
FTP_VERIFY: "false"
FTP_SECURE: "true"
HTTP_ROOT: "https://ci.joomla.org/artifacts"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
GITHUB_TOKEN:
from_secret: github_token
commands:
- if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi
- /bin/drone_build.sh
platform:
os: linux
arch: amd64
steps:
- name: packager
image: joomlaprojects/docker-images:packager
commands:
- if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi
- /bin/drone_build.sh
environment:
DRONE_COMMIT: DRONE_COMMIT
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
FTP_DEST_DIR: /artifacts
FTP_HOSTNAME: ci.joomla.org
FTP_PASSWORD:
from_secret: ftppassword
FTP_PORT: 21
FTP_SECURE: true
FTP_USERNAME:
from_secret: ftpusername
FTP_VERIFY: false
GITHUB_TOKEN:
from_secret: github_token
HTTP_ROOT: https://ci.joomla.org/artifacts
---
kind: signature
hmac: a825707d539b95fb82da2affd7ba513094430f48cd0d829d38c5f59a6b412d78
hmac: 0d8cd605edb021ed24ff59cc4a229dcd311ab9b9bbfba5194b3de00cdede60f3
...

View File

@ -1,13 +0,0 @@
fail_on_violations: false
scss:
enabled: false
jshint:
enabled: false
eslint:
enabled: false
ruby:
enabled: false

View File

@ -1,63 +0,0 @@
# Forces new Travis-CI Infrastructure
sudo: false
language: php
env:
global:
- RUN_UNIT_TESTS="yes"
- INSTALL_APCU="yes"
- INSTALL_MEMCACHED="yes"
- INSTALL_REDIS="yes"
matrix:
fast_finish: true
include:
# Requires older Precise image
- php: 5.3
env:
- INSTALL_APC="yes"
- INSTALL_APCU="no"
- INSTALL_MEMCACHE="yes"
sudo: true
dist: precise
# The new Trusty image has issues with running APC, do not enable it here
- php: 5.4
env:
- INSTALL_APCU="no"
- INSTALL_MEMCACHE="yes"
dist: trusty
- php: 5.5
env:
- INSTALL_MEMCACHE="yes"
dist: trusty
- php: 5.6
env:
- INSTALL_MEMCACHE="yes"
dist: trusty
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: nightly
allow_failures:
- php: nightly
services:
- memcache
- memcached
- redis-server
- mysql
- postgresql
before_script:
# Make sure all dev dependencies are installed
- if [[ $RUN_UNIT_TESTS == "yes" ]]; then bash build/travis/unit-tests.sh $PWD; fi
script:
- if [[ $RUN_UNIT_TESTS == "yes" ]]; then libraries/vendor/bin/phpunit --configuration travisci-phpunit.xml; fi
branches:
except:
- 2.5.x

View File

@ -1,11 +1,11 @@
Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon)
====================
Build Status
---------------------
| Travis-CI | Drone-CI | AppVeyor |
| ------------- | ------------- | ------------- |
| [![Build Status](https://travis-ci.org/joomla/joomla-cms.svg?branch=staging)](https://travis-ci.org/joomla/joomla-cms) | [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/staging?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) |
| Drone-CI | AppVeyor |
| ------------- | ------------- |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/staging?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) |
What is this?
---------------------

View File

@ -1,19 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/unit/bootstrap.php" colors="false">
<!-- These constants help setup environment configurations for running optional tests.
<!-- These constants help setup environment configurations for running optional tests. -->
<php>
<const name="JTEST_DATABASE_MYSQL_DSN" value="host=localhost;dbname=joomla_ut;user=utuser;pass=ut1234" />
<const name="JTEST_DATABASE_MYSQLI_DSN" value="host=localhost;dbname=joomla_ut;user=utuser;pass=ut1234" />
<const name="JTEST_DATABASE_PDO_MYSQL_DSN" value="host=localhost;dbname=joomla_ut;user=utuser;pass=ut1234" />
<const name="JTEST_DATABASE_POSTGRESQL_DSN" value="host=localhost;port=5432;dbname=joomla_ut;user=utuser;pass=ut1234" />
<const name="JTEST_DATABASE_SQLSRV_DSN" value="host=localhost;dbname=joomla_ut;user=utuser;pass=ut1234" />
<const name="JTEST_HTTP_STUB" value="http://localhost/joomla-cms/tests/unit/stubs/jhttp_stub.php" />
<const name="JTEST_DATABASE_MYSQL_DSN" value="host=mysql;dbname=joomla_ut;user=joomla_ut;pass=joomla_ut" />
<const name="JTEST_DATABASE_MYSQLI_DSN" value="host=mysql;dbname=joomla_ut;user=joomla_ut;pass=joomla_ut" />
<const name="JTEST_DATABASE_PDO_MYSQL_DSN" value="host=mysql;dbname=joomla_ut;user=joomla_ut;pass=joomla_ut" />
<const name="JTEST_DATABASE_POSTGRESQL_DSN" value="host=postgres;port=5432;dbname=joomla_ut;user=joomla_ut;pass=joomla_ut" />
<!--<const name="JTEST_DATABASE_SQLSRV_DSN" value="host=localhost;dbname=joomla_ut;user=utuser;pass=ut1234" />-->
<!--<const name="JTEST_HTTP_STUB" value="http://localhost/joomla-cms/tests/unit/stubs/jhttp_stub.php" />-->
<const name="JOOMLA_TEST_LOGGING" value="yes" />
<const name="JTEST_CACHE_REDIS_DSN" value="host=localhost;port=6379;db=;auth=" />
<const name="JTEST_CACHE_MEMCACHE_DSN" value="host=localhost;port=11211" />
<const name="JTEST_CACHE_MEMCACHED_DSN" value="host=localhost;port=11211" />
<const name="JTEST_CACHE_REDIS_DSN" value="host=redis;port=6379;db=;auth=" />
<const name="JTEST_CACHE_MEMCACHE_DSN" value="host=memcache;port=11211" />
<const name="JTEST_CACHE_MEMCACHED_DSN" value="host=memcached;port=11211" />
</php>
-->
<testsuites>
<testsuite name="libraries-cms">

View File

@ -32,8 +32,7 @@ class JCacheStorageMemcachedTest extends TestCaseCache
if ($dsn)
{
// First let's trim the redis: part off the front of the DSN if it exists.
// First let's trim the memcached: part off the front of the DSN if it exists.
if (strpos($dsn, 'memcached:') === 0)
{
$dsn = substr($dsn, 10);
@ -60,6 +59,10 @@ class JCacheStorageMemcachedTest extends TestCaseCache
}
}
}
else
{
$this->markTestSkipped('No configuration for Memcached given');
}
try
{
@ -67,7 +70,7 @@ class JCacheStorageMemcachedTest extends TestCaseCache
}
catch (JCacheExceptionConnecting $e)
{
$this->markTestSkipped('Failed to connect to Memcached');
$this->fail('Failed to connect to Memcached');
}
// Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)

View File

@ -27,33 +27,8 @@ class JCacheStorageRedisTest extends TestCaseCache
parent::setUp();
// Mock the returns on JApplicationCms::get() to use the default values
JFactory::$application->expects($this->any())
->method('get')
->will($this->returnCallback(array($this, 'applicationGetterCallback')));
$this->handler = new JCacheStorageRedis;
// This adapter doesn't throw an Exception on a connection failure so we'll have to use Reflection to get into the class to check it
if (!(TestReflection::getValue($this->handler, '_redis') instanceof Redis))
{
$this->markTestSkipped('Failed to connect to Redis');
}
// Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
$this->handler->_lifetime = 2;
}
/**
* Callback for application getter that returns redis credentials
*
* @return mixed
*/
public function applicationGetterCallback()
{
// Parse the DSN details for the test server
$dsn = defined('JTEST_CACHE_REDIS_DSN') ? JTEST_CACHE_REDIS_DSN : getenv('JTEST_CACHE_REDIS_DSN');
$args = func_get_args();
$dsn = defined('JTEST_CACHE_REDIS_DSN') ? JTEST_CACHE_REDIS_DSN : getenv('JTEST_CACHE_REDIS_DSN');
if ($dsn)
{
@ -63,33 +38,48 @@ class JCacheStorageRedisTest extends TestCaseCache
$dsn = substr($dsn, 6);
}
// Call getConfig once to have the registry object prepared
JFactory::getConfig();
// Split the DSN into its parts over semicolons.
$parts = explode(';', $dsn);
$connection = array();
// Parse each part and populate the options array.
foreach ($parts as $part)
{
list ($k, $v) = explode('=', $part, 2);
$connection[$k] = $v;
}
switch ($args[0])
{
case "redis_server_host":
return $connection["host"];
break;
case "redis_server_port":
return $connection["port"];
break;
case "redis_server_auth":
return $connection["auth"];
break;
case "redis_server_db":
return $connection["db"];
break;
switch ($k)
{
case 'host':
JFactory::$config->set("redis_server_host", $v);
break;
case 'port':
JFactory::$config->set("redis_server_port", $v);
break;
case 'db':
JFactory::$config->set("redis_server_db", $v);
break;
case 'auth':
JFactory::$config->set("redis_server_auth", $v);
break;
}
}
}
return $args[1];
else
{
$this->markTestSkipped('No configuration for Redis given');
}
try
{
$this->handler = new JCacheStorageRedis;
}
catch (JCacheExceptionConnecting $e)
{
$this->fail('Failed to connect to Redis');
}
// Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
$this->handler->_lifetime = 2;
}
}

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/unit/bootstrap.php" colors="true">
<php>
<const name="JTEST_DATABASE_MYSQL_DSN" value="host=localhost;dbname=joomla_ut;user=root;pass=" />
<const name="JTEST_DATABASE_MYSQLI_DSN" value="host=localhost;dbname=joomla_ut;user=root;pass=" />
<const name="JTEST_DATABASE_PDO_MYSQL_DSN" value="host=localhost;dbname=joomla_ut;user=root;pass=" />
<const name="JTEST_DATABASE_POSTGRESQL_DSN" value="host=localhost;port=5432;dbname=joomla_ut;user=postgres;pass=" />
<!-- <const name="JTEST_HTTP_STUB" value="http://localhost/tests/unit/stubs/jhttp_stub.php" /> -->
</php>
<testsuites>
<testsuite name="libraries-cms">
<directory>tests/unit/suites/libraries/cms</directory>
</testsuite>
<testsuite name="libraries-platform">
<directory>tests/unit/suites/libraries/joomla</directory>
</testsuite>
<testsuite name="libraries-legacy">
<directory>tests/unit/suites/libraries/legacy</directory>
</testsuite>
<testsuite name="database">
<directory>tests/unit/suites/database</directory>
</testsuite>
<testsuite name="administrator">
<directory>tests/unit/suites/administrator</directory>
</testsuite>
<testsuite name="FinderIndexer">
<directory>tests/unit/suites/finderIndexer</directory>
</testsuite>
<testsuite name="plugins">
<directory>tests/unit/suites/plugins</directory>
</testsuite>
</testsuites>
</phpunit>