Merge pull request #14661 from mauriciofauth/travisci-windows
Add Windows to test matrix on Travis CI
This commit is contained in:
commit
acb968f74e
17
.travis.yml
17
.travis.yml
@ -13,9 +13,9 @@ services:
|
||||
sudo: required
|
||||
|
||||
install:
|
||||
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi
|
||||
- ./test/ci-install-$CI_MODE
|
||||
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi
|
||||
|
||||
before_script:
|
||||
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
|
||||
@ -89,6 +89,18 @@ jobs:
|
||||
php: "nightly"
|
||||
name: "PHP nightly"
|
||||
env: CI_MODE=test
|
||||
- stage: "PHP Unit tests"
|
||||
name: "PHP 7.2"
|
||||
os: windows
|
||||
language: sh
|
||||
env: CI_MODE=test
|
||||
before_install:
|
||||
- choco install php composer mariadb
|
||||
- export PATH=/c/tools/php72:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.2"/bin:$PATH
|
||||
- PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
|
||||
- for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php72/php.ini ; done
|
||||
- sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php72/php.ini
|
||||
- find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
|
||||
- stage: "Other tests"
|
||||
name: "Build release"
|
||||
php: "7.1"
|
||||
@ -132,6 +144,7 @@ jobs:
|
||||
env: CI_MODE=test
|
||||
- php: "7.2"
|
||||
env: CI_MODE=phpstan
|
||||
- os: windows
|
||||
|
||||
cache:
|
||||
pip: true
|
||||
|
||||
@ -458,7 +458,7 @@ class Config
|
||||
return;
|
||||
}
|
||||
// split file to lines
|
||||
$ref_lines = explode("\n", $packed_refs);
|
||||
$ref_lines = explode(PHP_EOL, $packed_refs);
|
||||
foreach ($ref_lines as $line) {
|
||||
// skip comments
|
||||
if ($line[0] == '#') {
|
||||
|
||||
@ -154,11 +154,9 @@ class Innodb extends StorageEngine
|
||||
// The following query is only possible because we know
|
||||
// that we are on MySQL 5 here (checked above)!
|
||||
// side note: I love MySQL 5 for this. :-)
|
||||
$sql
|
||||
= '
|
||||
SHOW STATUS
|
||||
WHERE Variable_name LIKE \'Innodb\\_buffer\\_pool\\_%\'
|
||||
OR Variable_name = \'Innodb_page_size\';';
|
||||
$sql = 'SHOW STATUS'
|
||||
. ' WHERE Variable_name LIKE \'Innodb\\_buffer\\_pool\\_%\''
|
||||
. ' OR Variable_name = \'Innodb_page_size\';';
|
||||
$status = $GLOBALS['dbi']->fetchResult($sql, 0, 1);
|
||||
|
||||
$output = '<table class="data" id="table_innodb_bufferpool_usage">' . "\n"
|
||||
|
||||
@ -174,9 +174,9 @@ class HttpRequest
|
||||
*/
|
||||
if (curl_getinfo($curlHandle, CURLINFO_SSL_VERIFYRESULT) != 0) {
|
||||
if ($ssl == 0) {
|
||||
$this->curl($url, $method, $returnOnlyStatus, $content, $header, CURLOPT_CAINFO);
|
||||
return $this->curl($url, $method, $returnOnlyStatus, $content, $header, CURLOPT_CAINFO);
|
||||
} elseif ($ssl == CURLOPT_CAINFO) {
|
||||
$this->curl($url, $method, $returnOnlyStatus, $content, $header, CURLOPT_CAPATH);
|
||||
return $this->curl($url, $method, $returnOnlyStatus, $content, $header, CURLOPT_CAPATH);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -785,16 +785,14 @@ class ConfigTest extends PmaTestCase
|
||||
|
||||
//load file permissions for the current permissions file
|
||||
$perms = @fileperms($this->permTestObj->getSource());
|
||||
//testing for permissions
|
||||
$this->assertFalse(!($perms === false) && ($perms & 2));
|
||||
|
||||
//if the above assertion is false then applying further assertions
|
||||
if (!($perms === false) && ($perms & 2)) {
|
||||
$this->assertNotSame(0, $this->permTestObj->get('PMA_IS_WINDOWS'));
|
||||
$this->assertTrue((bool) $this->permTestObj->get('PMA_IS_WINDOWS'));
|
||||
} else {
|
||||
$this->assertFalse((bool) $this->permTestObj->get('PMA_IS_WINDOWS'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test for setting cookies
|
||||
*
|
||||
|
||||
@ -1526,12 +1526,12 @@ class ResultsTest extends PmaTestCase
|
||||
[],
|
||||
0,
|
||||
'binary',
|
||||
'<td class="left hex">' . PHP_EOL
|
||||
'<td class="left hex">' . "\n"
|
||||
. ' <a href="tbl_get_field.php?'
|
||||
. 'db=foo&table=tbl&server=0&lang=en'
|
||||
. '" '
|
||||
. 'class="disableAjax">[BLOB - 4 B]</a>' . PHP_EOL
|
||||
. '</td>' . PHP_EOL
|
||||
. 'class="disableAjax">[BLOB - 4 B]</a>' . "\n"
|
||||
. '</td>' . "\n"
|
||||
],
|
||||
[
|
||||
'noblob',
|
||||
@ -1548,9 +1548,9 @@ class ResultsTest extends PmaTestCase
|
||||
[],
|
||||
0,
|
||||
'binary',
|
||||
'<td class="left grid_edit transformed hex">' . PHP_EOL
|
||||
. ' 1001' . PHP_EOL
|
||||
. '</td>' . PHP_EOL
|
||||
'<td class="left grid_edit transformed hex">' . "\n"
|
||||
. ' 1001' . "\n"
|
||||
. '</td>' . "\n"
|
||||
],
|
||||
[
|
||||
'noblob',
|
||||
@ -1567,12 +1567,12 @@ class ResultsTest extends PmaTestCase
|
||||
[],
|
||||
0,
|
||||
0,
|
||||
'<td ' . PHP_EOL
|
||||
. ' data-decimals="0"' . PHP_EOL
|
||||
. ' data-type="string"' . PHP_EOL
|
||||
. ' class="grid_edit null">' . PHP_EOL
|
||||
. ' <em>NULL</em>' . PHP_EOL
|
||||
. '</td>' . PHP_EOL
|
||||
'<td ' . "\n"
|
||||
. ' data-decimals="0"' . "\n"
|
||||
. ' data-type="string"' . "\n"
|
||||
. ' class="grid_edit null">' . "\n"
|
||||
. ' <em>NULL</em>' . "\n"
|
||||
. '</td>' . "\n"
|
||||
],
|
||||
[
|
||||
'all',
|
||||
|
||||
@ -98,8 +98,11 @@ class ErrorTest extends PmaTestCase
|
||||
public function filePathProvider()
|
||||
{
|
||||
return [
|
||||
['./ChangeLog', './ChangeLog'],
|
||||
[__FILE__, './test/classes/ErrorTest.php'],
|
||||
['./ChangeLog', '.' . DIRECTORY_SEPARATOR . 'ChangeLog'],
|
||||
[
|
||||
__FILE__,
|
||||
'.' . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'ErrorTest.php'
|
||||
],
|
||||
['./NONEXISTING', 'NONEXISTING'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -148,14 +148,15 @@ class ZipExtensionTest extends PmaTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get ZipArchive for content.
|
||||
* Test for createFile
|
||||
*
|
||||
* @param mixed $file file
|
||||
*
|
||||
* @return ZipArchive
|
||||
* @return void
|
||||
*/
|
||||
private function getZip($file)
|
||||
public function testCreateSingleFile()
|
||||
{
|
||||
$file = $this->zipExtension->createFile("Test content", "test.txt");
|
||||
$this->assertNotEmpty($file);
|
||||
|
||||
$tmp = tempnam('./', 'zip-test');
|
||||
$handle = fopen($tmp, 'w');
|
||||
fwrite($handle, $file);
|
||||
@ -166,24 +167,10 @@ class ZipExtensionTest extends PmaTestCase
|
||||
$zip->open($tmp)
|
||||
);
|
||||
|
||||
unlink($tmp);
|
||||
|
||||
return $zip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for createFile
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCreateSingleFile()
|
||||
{
|
||||
$file = $this->zipExtension->createFile("Test content", "test.txt");
|
||||
$this->assertNotEmpty($file);
|
||||
|
||||
$zip = $this->getZip($file);
|
||||
|
||||
$this->assertEquals(0, $zip->locateName('test.txt'));
|
||||
|
||||
$zip->close();
|
||||
unlink($tmp);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -214,8 +201,21 @@ class ZipExtensionTest extends PmaTestCase
|
||||
["name1.txt", "name2.txt"]
|
||||
);
|
||||
$this->assertNotEmpty($file);
|
||||
$zip = $this->getZip($file);
|
||||
|
||||
$tmp = tempnam('./', 'zip-test');
|
||||
$handle = fopen($tmp, 'w');
|
||||
fwrite($handle, $file);
|
||||
fclose($handle);
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$this->assertTrue(
|
||||
$zip->open($tmp)
|
||||
);
|
||||
|
||||
$this->assertEquals(0, $zip->locateName('name1.txt'));
|
||||
$this->assertEquals(1, $zip->locateName('name2.txt'));
|
||||
|
||||
$zip->close();
|
||||
unlink($tmp);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user