forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
73 lines (72 loc) · 3.46 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
sudo: required
dist: trusty
language: php
php:
- 5.5
- 5.6
- 7.0
env:
- TEST_SUITE=unit
- TEST_SUITE=integration_part_1
- TEST_SUITE=integration_part_2
- TEST_SUITE=integration_integrity
- TEST_SUITE=static_phpcs
- TEST_SUITE=static_annotation
cache:
apt: true
directories:
- $HOME/.composer/cache
- $HOME/.cache/bin
matrix:
exclude:
- php: 5.6
env: TEST_SUITE=static_phpcs
- php: 5.6
env: TEST_SUITE=static_annotation
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq postfix
- sh -c 'if [ "$CASHER_DIR" ]; then
if [ -x $HOME/.cache/bin/composer ]; then
$HOME/.cache/bin/composer self-update; echo '';
else
mkdir -p $HOME/.cache/bin;
curl --connect-timeout 30 -sS https://getcomposer.org/installer
| php -- --install-dir $HOME/.cache/bin/ --filename composer;
fi
fi'
- export PATH="$HOME/.cache/bin:$PATH"
before_script:
# Mock mail
- sudo service postfix stop
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
- echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' > $(php --ini|grep -m 1 "ini files in:"|cut -d ":" -f 2)/sendmail.ini
# Disable xDebug
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
# Install MySQL 5.6, create DB for integration tests
- >
sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ] || [ '$TEST_SUITE' = 'integration_part_2' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then
sudo apt-get remove -y -qq --purge mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5;
sudo apt-get -y -qq autoremove;
sudo apt-get -y -qq autoclean;
sudo apt-get install -y -qq mysql-server-5.6 mysql-client-5.6;
mysql -uroot -e 'SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION; CREATE DATABASE magento_integration_tests;';
mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php;
fi"
# Change memory_limit for travis
- echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- phpenv rehash;
- composer install --no-interaction --prefer-dist
script:
# Unit tests
- sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi"
# Integration tests
- sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ] || [ '$TEST_SUITE' = 'integration_part_2' ]; then cd dev/tests/integration/; bash IntegationTestsForTravis.sh 2; fi"
- sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.travis1; fi"
- sh -c "if [ '$TEST_SUITE' = 'integration_part_2' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.travis2; fi"
# Integration integrity tests
- sh -c "if [ '$TEST_SUITE' = 'integration_integrity' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.dist testsuite/Magento/Test/Integrity; fi"
# Static tests [Code Style]
- sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testCodeStyle'; fi"
# Static tests [Code Style]
- sh -c "if [ '$TEST_SUITE' = 'static_annotation' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testAnnotationStandard'; fi"