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

Simplify Travis CI test matrix for Mac OS X setup and skip all TLS tests on legacy HHVM #235

Merged
merged 2 commits into from
May 21, 2020
Merged
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
21 changes: 5 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,19 @@ matrix:
- php: 7.4
- php: hhvm-3.18
install: composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit
- os: osx
- name: Mac OS X
os: osx
language: generic
php: 7.0 # just to look right on travis
env:
- PACKAGE: php70
before_install:
- curl -s http://getcomposer.org/installer | php
- mv composer.phar /usr/local/bin/composer
allow_failures:
- php: hhvm-3.18
- os: osx

sudo: false

install:
# OSX install inspired by https://github.com/kiler129/TravisCI-OSX-PHP
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew tap homebrew/homebrew-php
echo "Installing PHP ..."
brew install "${PACKAGE}"
brew install "${PACKAGE}"-xdebug
brew link "${PACKAGE}"
echo "Installing composer ..."
curl -s http://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
fi
- composer install --no-interaction

script:
Expand Down
5 changes: 2 additions & 3 deletions tests/FunctionalConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ public function connectionToTcpServerShouldSucceedWithLocalhost()
$loop = Factory::create();

$server = new TcpServer(9998, $loop);
$server->on('connection', $this->expectCallableOnce());
$server->on('connection', array($server, 'close'));

$connector = new Connector($loop);

$connection = Block\await($connector->connect('localhost:9998'), $loop, self::TIMEOUT);

$server->close();

$this->assertInstanceOf('React\Socket\ConnectionInterface', $connection);

$connection->close();
$server->close();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/FunctionalSecureServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class FunctionalSecureServerTest extends TestCase

public function setUp()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}
}

Expand Down
16 changes: 8 additions & 8 deletions tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function gettingStuffFromGoogleShouldWork()
/** @test */
public function gettingEncryptedStuffFromGoogleShouldWork()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}

$loop = Factory::create();
Expand All @@ -55,8 +55,8 @@ public function gettingEncryptedStuffFromGoogleShouldWork()
/** @test */
public function gettingEncryptedStuffFromGoogleShouldWorkIfHostIsResolvedFirst()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}

$loop = Factory::create();
Expand Down Expand Up @@ -363,8 +363,8 @@ public function testConnectingFailsIfTimeoutIsTooSmall()

public function testSelfSignedRejectsIfVerificationIsEnabled()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}

$loop = Factory::create();
Expand All @@ -381,8 +381,8 @@ public function testSelfSignedRejectsIfVerificationIsEnabled()

public function testSelfSignedResolvesIfVerificationIsDisabled()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}

$loop = Factory::create();
Expand Down
4 changes: 2 additions & 2 deletions tests/SecureConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class SecureConnectorTest extends TestCase

public function setUp()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}

$this->loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
Expand Down
4 changes: 2 additions & 2 deletions tests/SecureIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class SecureIntegrationTest extends TestCase

public function setUp()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}

$this->loop = LoopFactory::create();
Expand Down
4 changes: 2 additions & 2 deletions tests/SecureServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class SecureServerTest extends TestCase
{
public function setUp()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}
}

Expand Down
7 changes: 5 additions & 2 deletions tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public function testConstructorCreatesExpectedTcpServer()

public function testConstructorCreatesExpectedUnixServer()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}
if (!in_array('unix', stream_get_transports())) {
$this->markTestSkipped('Unix domain sockets (UDS) not supported on your platform (Windows?)');
}
Expand Down Expand Up @@ -182,8 +185,8 @@ public function testEmitsConnectionWithInheritedContextOptions()

public function testDoesNotEmitSecureConnectionForNewPlaintextConnectionThatIsIdle()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on legacy HHVM');
}

$loop = Factory::create();
Expand Down
13 changes: 5 additions & 8 deletions tests/TcpConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public function connectionToTcpServerShouldSucceed()
$loop = Factory::create();

$server = new TcpServer(9999, $loop);
$server->on('connection', $this->expectCallableOnce());
$server->on('connection', array($server, 'close'));

$connector = new TcpConnector($loop);

Expand All @@ -61,6 +59,7 @@ public function connectionToTcpServerShouldSucceed()
$this->assertInstanceOf('React\Socket\ConnectionInterface', $connection);

$connection->close();
$server->close();
}

/** @test */
Expand All @@ -69,7 +68,6 @@ public function connectionToTcpServerShouldSucceedWithRemoteAdressSameAsTarget()
$loop = Factory::create();

$server = new TcpServer(9999, $loop);
$server->on('connection', array($server, 'close'));

$connector = new TcpConnector($loop);

Expand All @@ -79,6 +77,7 @@ public function connectionToTcpServerShouldSucceedWithRemoteAdressSameAsTarget()
$this->assertEquals('tcp://127.0.0.1:9999', $connection->getRemoteAddress());

$connection->close();
$server->close();
}

/** @test */
Expand All @@ -87,7 +86,6 @@ public function connectionToTcpServerShouldSucceedWithLocalAdressOnLocalhost()
$loop = Factory::create();

$server = new TcpServer(9999, $loop);
$server->on('connection', array($server, 'close'));

$connector = new TcpConnector($loop);

Expand All @@ -98,6 +96,7 @@ public function connectionToTcpServerShouldSucceedWithLocalAdressOnLocalhost()
$this->assertNotEquals('tcp://127.0.0.1:9999', $connection->getLocalAddress());

$connection->close();
$server->close();
}

/** @test */
Expand All @@ -106,13 +105,13 @@ public function connectionToTcpServerShouldSucceedWithNullAddressesAfterConnecti
$loop = Factory::create();

$server = new TcpServer(9999, $loop);
$server->on('connection', array($server, 'close'));

$connector = new TcpConnector($loop);

$connection = Block\await($connector->connect('127.0.0.1:9999'), $loop, self::TIMEOUT);
/* @var $connection ConnectionInterface */

$server->close();
$connection->close();

$this->assertNull($connection->getRemoteAddress());
Expand Down Expand Up @@ -165,9 +164,6 @@ public function connectionToIp6TcpServerShouldSucceed()
$this->markTestSkipped('Unable to start IPv6 server socket (IPv6 not supported on this system?)');
}

$server->on('connection', $this->expectCallableOnce());
$server->on('connection', array($server, 'close'));

$connector = new TcpConnector($loop);

$connection = Block\await($connector->connect('[::1]:9999'), $loop, self::TIMEOUT);
Expand All @@ -179,6 +175,7 @@ public function connectionToIp6TcpServerShouldSucceed()
$this->assertNotEquals('tcp://[::1]:9999', $connection->getLocalAddress());

$connection->close();
$server->close();
}

/** @test */
Expand Down