-
Notifications
You must be signed in to change notification settings - Fork 127
/
.travis.yml
77 lines (77 loc) · 3.64 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
language: php
php:
- 5.5
- 5.6
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 -e '#!/usr/bin/env bash\nexit 0' | sudo tee /usr/sbin/sendmail
- >
echo 'sendmail_path = "/usr/sbin/sendmail -t -i "'
| sudo tee "/home/travis/.phpenv/versions/`php -i
| grep "PHP Version"
| head -n 1
| grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/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 --purge mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5;
sudo apt-get autoremove;
sudo apt-get autoclean;
sudo apt-add-repository ppa:ondrej/mysql-5.6 -y;
sudo apt-get update;
sudo apt-get install 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"