Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Travis CI builds #786

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: php
php:
- 5.4
- 5.5
- 5.6
env:
- TEST_SUITE=unit
- TEST_SUITE=integration
Expand All @@ -10,6 +11,10 @@ env:
- TEST_SUITE=static_annotation
matrix:
exclude:
- php: 5.4
env: TEST_SUITE=static_phpcs
- php: 5.4
env: TEST_SUITE=static_annotation
- php: 5.5
env: TEST_SUITE=static_phpcs
- php: 5.5
Expand All @@ -18,22 +23,34 @@ before_install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq postfix
before_script:
# mock mail
# 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"
- >
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
# Create DB for Integration tests
- sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then mysql -e '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"
# Install tools for static tests
- sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ] || [ '$TEST_SUITE' = 'static_annotation' ]; then pear install pear/PHP_CodeSniffer-1.5.2; fi"
# Change memmory_limit for travis server
# Install MySQL 5.6, create DB for integration tests
- >
sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$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-source --dev
- cd ..
- composer install --no-interaction --dev
script:
# Unit tests
- sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi"
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Directory/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ public function getRegionJson()
];
}
$json = $this->_coreHelper->jsonEncode($regions);

if ($json === false) {
$json = 'false';
}
$this->_configCacheType->save($json, $cacheKey);
}
$this->_regionJson = $json;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"AFL-3.0"
],
"require": {
"php": "~5.4.11|~5.5.0",
"php": "~5.4.11|~5.5.0|~5.6.0",
"zendframework/zend-stdlib": "2.3.1",
"zendframework/zend-code": "2.3.1",
"zendframework/zend-server": "2.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ protected function _assignConfigData(\PHPUnit_Framework_TestCase $test)
if (preg_match('/^.+?(?=_store\s)/', $configPathAndValue, $matches)) {
/* Store-scoped config value */
$storeCode = $matches[0] != 'current' ? $matches[0] : null;
list(, $configPath, $requiredValue) = preg_split('/\s+/', $configPathAndValue, 3);
$parts = preg_split('/\s+/', $configPathAndValue, 3);
list(, $configPath, $requiredValue) = $parts + ['', '', ''];
$originalValue = $this->_getConfigValue($configPath, $storeCode);
$this->_storeConfigValues[$storeCode][$configPath] = $originalValue;
$this->_setConfigValue($configPath, $requiredValue, $storeCode);
Expand Down