forked from ezsystems/ezpublish-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
105 lines (92 loc) · 4.94 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Use trusty for better performance (and avoiding mysql/postgres/solr gone issues on precise and container infra)
dist: trusty
sudo: required
language: php
services:
- mysql
- postgresql
- redis-server
# Mysql isn't installed on trusty (only client is), so we need to specifically install it
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
cache:
directories:
- $HOME/.composer/cache/files
env:
global:
# For functional and acceptance tests
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/selenium.yml"
matrix:
fast_finish: true
include:
# 7.1
- php: 7.1
env: TEST_CONFIG="phpunit.xml"
- php: 7.1
env: REST_TEST_CONFIG="phpunit-functional-rest.xml" SYMFONY_ENV=behat SYMFONY_DEBUG=1 SF_CMD="ez:behat:create-language 'pol-PL' 'Polish (polski)'"
- php: 7.1
env: BEHAT_OPTS="--profile=rest --tags=~@broken --suite=fullJson" SYMFONY_ENV=behat
- php: 7.1
env: SOLR_VERSION="6.4.2" TEST_CONFIG="phpunit-integration-legacy-solr.xml" CUSTOM_CACHE_POOL="singleredis" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml"
- php: 7.1
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
- php: 7.1
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb"
# Disabled as it currently fails, integration tests are not written for language config awareness in Repo, should probably be opt in by test
# - php: 7.1
# env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb" REPOSITORY_SERVICE_ID="ezpublish.siteaccessaware.repository"
# 7.2
- php: 7.2
env: TEST_CONFIG="phpunit.xml"
- php: 7.2
env: ELASTICSEARCH_VERSION="1.4.2" TEST_CONFIG="phpunit-integration-legacy-elasticsearch.xml"
- name: Legacy Storage engine tests with MariaDB 10.3
php: 7.1
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mariadb" DATABASE="mysql://root@localhost/testdb"
addons:
mariadb: 10.3
# test only master, stable branches and pull requests
branches:
only:
- master
- /^\d.\d+$/
# setup requirements for running unit/integration/behat tests
before_install:
# Disable memory_limit for composer
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Install igbinary & lzf PHP extensions if necessary
- if [ "$ENABLE_IGBINARY" = true ] ; then pecl install igbinary ; fi
- if [ "$ENABLE_LZF" = true ] ; then printf "no\n" | pecl install lzf ; fi
# Prepare system
- if [ "$TEST_CONFIG" != "" ] ; then ./bin/.travis/prepare_unittest.sh ; fi
- if [ "$BEHAT_OPTS" != "" ] || [ "$REST_TEST_CONFIG" != "" ] ; then ./bin/.travis/prepare_behat.sh ; fi
# Execute Symfony command if specified
- if [ "$SF_CMD" != "" ] ; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "bin/console $SF_CMD" ; fi
# Detecting timezone issues by testing on random timezone
- TEST_TIMEZONES=("America/New_York" "Asia/Calcutta" "UTC")
- TEST_TIMEZONE=${TEST_TIMEZONES["`shuf -i 0-2 -n 1`"]}
install:
- if [ "$TEST_CONFIG" != "" ] ; then travis_retry composer install --no-progress --no-interaction --prefer-dist ; fi
# Setup Solr / Elastic search if asked for
- if [ "$TEST_CONFIG" = "phpunit-integration-legacy-elasticsearch.xml" ] ; then ./bin/.travis/init_elasticsearch.sh ; fi
- if [ "$TEST_CONFIG" = "phpunit-integration-legacy-solr.xml" ] ; then ./vendor/ezsystems/ezplatform-solr-search-engine/bin/.travis/init_solr.sh; fi
# execute phpunit or behat as the script command
script:
- if [ "$TEST_CONFIG" != "" ] ; then php -d date.timezone=$TEST_TIMEZONE -d memory_limit=-1 vendor/bin/phpunit -c $TEST_CONFIG ; fi
- if [ "$BEHAT_OPTS" != "" ] ; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "bin/behat $BEHAT_OPTS" ; fi
- if [ "$REST_TEST_CONFIG" != "" ] ; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "php -d date.timezone=$TEST_TIMEZONE -d memory_limit=-1 bin/phpunit -v vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishRestBundle/Tests/Functional" ; fi
notifications:
slack:
rooms:
- secure: Xb/nKrA5C4E5pNZulEVht1fT4gsOgoQp9WDNWVSBXz8i8JVPUZo20MtKt67pXK2SmxXbgY8aWbHrD1Y3Lv5YLUCHPJQKVxFiDLTh7sACxvHoEa8EuLiQo9naitMSXL1S4PaC8ptaVn9fe2Fwfg+ydSFLCsFDa+qmdBYjNaf8W4M=
- secure: qEgnhpVaWJZQNvJRisv5Kb1vfuZ4H0LjPGWdTk9Q1+MmQMhv/zGV1Z/H1+FEmxlZxk7zrC5ooLs5+K5Nf24XycAM1yczYWGBWJa0P+WKO1KfPx/NbOdSugXIKfbW4JcmwY5mpxPHf+9nUbEOv6zu3cOhWJg41MbTLcGRle+NZVc=
on_success: change
on_failure: always
on_pull_requests: false
# reduce depth (history) of git checkout
git:
depth: 30