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

Run tests on PHP 7.4 and simplify test matrix #223

Merged
merged 1 commit into from
Mar 5, 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
26 changes: 12 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
language: php

php:
# - 5.3 # requires old distro, see below
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
# - 7.0 # Mac OS X, ignore errors, see below
- hhvm # ignore errors, see below

# lock distro so new future defaults will not break the build
dist: trusty

matrix:
include:
- php: 5.3
dist: precise
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: hhvm-3.18
install: composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit
- os: osx
language: generic
php: 7.0 # just to look right on travis
env:
- PACKAGE: php70
allow_failures:
- php: hhvm
- php: hhvm-3.18
- os: osx

sudo: false
Expand All @@ -46,4 +44,4 @@ install:
- composer install --no-interaction

script:
- ./vendor/bin/phpunit --coverage-text
- vendor/bin/phpunit --coverage-text
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"require-dev": {
"clue/block-react": "^1.2",
"phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
"phpunit/phpunit": "^7.5 || ^6.4 || ^5.7 || ^4.8.35"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
Expand Down
1 change: 1 addition & 0 deletions tests/DnsConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public function testRejectionDuringDnsLookupShouldNotCreateAnyGarbageReferences(
}

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$dns = new Deferred();
$this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('example.com'))->willReturn($dns->promise());
Expand Down
2 changes: 2 additions & 0 deletions tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public function testCancellingPendingConnectionWithoutTimeoutShouldNotCreateAnyG
$connector = new Connector($loop, array('timeout' => false));

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$promise = $connector->connect('8.8.8.8:80');
$promise->cancel();
unset($promise);
Expand Down
1 change: 1 addition & 0 deletions tests/SecureConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public function testRejectionDuringConnectionShouldNotCreateAnyGarbageReferences
}

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$tcp = new Deferred();
$this->tcp->expects($this->once())->method('connect')->willReturn($tcp->promise());
Expand Down
1 change: 1 addition & 0 deletions tests/TcpConnectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public function testCancelDuringConnectionShouldNotCreateAnyGarbageReferences()
}

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
$connector = new TcpConnector($loop);
Expand Down