|
1 | 1 | sudo: required
|
2 | 2 | dist: trusty
|
3 |
| - |
| 3 | +addons: |
| 4 | + apt: |
| 5 | + packages: |
| 6 | + - mysql-server-5.6 |
| 7 | + - mysql-client-core-5.6 |
| 8 | + - mysql-client-5.6 |
| 9 | + - postfix |
4 | 10 | language: php
|
5 | 11 | php:
|
6 | 12 | - 5.5
|
7 | 13 | - 5.6
|
8 | 14 | - 7.0
|
9 | 15 | env:
|
10 |
| - - TEST_SUITE=unit |
11 |
| - - TEST_SUITE=integration_part_1 |
12 |
| - - TEST_SUITE=integration_part_2 |
13 |
| - - TEST_SUITE=integration_integrity |
14 |
| - - TEST_SUITE=static |
| 16 | + global: |
| 17 | + - COMPOSER_BIN_DIR=~/bin |
| 18 | + - INTEGRATION_SETS=2 |
| 19 | + matrix: |
| 20 | + - TEST_SUITE=unit |
| 21 | + - TEST_SUITE=integration INTEGRATION_INDEX=1 |
| 22 | + - TEST_SUITE=integration INTEGRATION_INDEX=2 |
| 23 | + - TEST_SUITE=static |
15 | 24 | cache:
|
16 | 25 | apt: true
|
17 |
| - directories: |
18 |
| - - $HOME/.composer/cache |
19 |
| - - $HOME/.cache/bin |
| 26 | + directories: $HOME/.composer/cache |
20 | 27 | matrix:
|
21 | 28 | exclude:
|
22 | 29 | - php: 5.6
|
23 | 30 | env: TEST_SUITE=static
|
24 | 31 | - php: 7.0
|
25 | 32 | env: TEST_SUITE=static
|
26 |
| -before_install: |
27 |
| - - sudo apt-get update -qq |
28 |
| - - sudo apt-get install -y -qq postfix |
29 |
| - - sh -c 'if [ "$CASHER_DIR" ]; then |
30 |
| - if [ -x $HOME/.cache/bin/composer ]; then |
31 |
| - $HOME/.cache/bin/composer self-update; echo ''; |
32 |
| - else |
33 |
| - mkdir -p $HOME/.cache/bin; |
34 |
| - curl --connect-timeout 30 -sS https://getcomposer.org/installer |
35 |
| - | php -- --install-dir $HOME/.cache/bin/ --filename composer; |
36 |
| - fi |
37 |
| - fi' |
38 |
| - - export PATH="$HOME/.cache/bin:$PATH" |
39 |
| -before_script: |
40 |
| - # Mock mail |
41 |
| - - sudo service postfix stop |
42 |
| - - smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 & |
43 |
| - - echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' > $(php --ini|grep -m 1 "ini files in:"|cut -d ":" -f 2)/sendmail.ini |
44 |
| - # Disable xDebug |
45 |
| - - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini |
46 |
| - # Install MySQL 5.6, create DB for integration tests |
47 |
| - - > |
48 |
| - sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ] || [ '$TEST_SUITE' = 'integration_part_2' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then |
49 |
| - 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; |
50 |
| - sudo apt-get -y -qq autoremove; |
51 |
| - sudo apt-get -y -qq autoclean; |
52 |
| - sudo apt-get install -y -qq mysql-server-5.6 mysql-client-5.6; |
53 |
| - mysql -uroot -e 'SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION; CREATE DATABASE magento_integration_tests;'; |
54 |
| - mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php; |
55 |
| - fi" |
56 |
| - # Change memory_limit for travis |
57 |
| - - echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini |
58 |
| - - phpenv rehash; |
59 |
| - - composer install --no-interaction --prefer-dist |
60 |
| -script: |
61 |
| - # Unit tests |
62 |
| - - sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi" |
63 |
| - # Integration tests |
64 |
| - - sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ] || [ '$TEST_SUITE' = 'integration_part_2' ]; then cd dev/tests/integration/; bash IntegationTestsForTravis.sh 2; fi" |
65 |
| - - sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.travis1; fi" |
66 |
| - - sh -c "if [ '$TEST_SUITE' = 'integration_part_2' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.travis2; fi" |
67 |
| - # Integration integrity tests |
68 |
| - - sh -c "if [ '$TEST_SUITE' = 'integration_integrity' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.dist testsuite/Magento/Test/Integrity; fi" |
69 |
| - # Static tests [Code Style] |
70 |
| - - sh -c "if [ '$TEST_SUITE' = 'static' ]; then cd dev/tests/static/; php get_github_changes.php --output-file='$TRAVIS_BUILD_DIR/dev/tests/static/testsuite/Magento/Test/_files/changed_files_ce.txt' --base-path='$TRAVIS_BUILD_DIR' --repo='https://github.com/magento/magento2.git' --branch='develop'; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest'; fi" |
| 33 | +before_install: ./dev/travis/before_install.sh |
| 34 | +install: composer install --no-interaction --prefer-dist |
| 35 | +before_script: ./dev/travis/before_script.sh |
| 36 | +script: |
| 37 | + - cd dev/tests/$TEST_SUITE |
| 38 | + - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true |
| 39 | + - phpunit $TEST_FILTER |
0 commit comments