-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Converted coroutines to futures #36
base: master
Are you sure you want to change the base?
Changes from all commits
dd36cfa
4796241
4ff7b21
36ae23c
cb1dba7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: | ||
- 8.1 | ||
dependencies: | ||
- hi | ||
- lo | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Beanstalk | ||
run: sudo apt-get install --yes beanstalkd | ||
|
||
- name: Setup PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: xdebug | ||
|
||
- name: Validate composer.json | ||
run: composer validate | ||
|
||
- name: Cache dependencies | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: php-${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }} | ||
restore-keys: php-${{ matrix.php }}-${{ matrix.dependencies }}- | ||
|
||
- name: Install dependencies ${{ matrix.dependencies == 'lo' && '(lowest)' || '' }} | ||
run: composer update --no-interaction --no-progress | ||
${{ matrix.dependencies == 'lo' && '--prefer-lowest' || '' }} | ||
|
||
- name: Run test suite with coverage | ||
run: composer test -- --coverage-clover=build/logs/clover.xml | ||
env: | ||
AMP_TEST_BEANSTALK_INTEGRATION: 1 | ||
|
||
- name: Check code style | ||
run: composer cs | ||
|
||
- name: Upload test coverage | ||
run: composer global require php-coveralls/php-coveralls && php-coveralls -v | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
/.*/ | ||
!/.github/ | ||
/coverage/ | ||
/composer.lock | ||
/vendor/ | ||
/protocol.txt | ||
/.php_cs.cache | ||
/.php-cs-fixer.cache | ||
.phpunit.result.cache |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,14 @@ | |
|
||
use Amp\Beanstalk\BeanstalkClient; | ||
use Amp\Beanstalk\Stats\System; | ||
use Amp\Loop; | ||
|
||
Loop::run(function () { | ||
$beanstalk = new BeanstalkClient("tcp://127.0.0.1:11300"); | ||
$beanstalk = new BeanstalkClient('tcp://127.0.0.1:11300'); | ||
|
||
/** | ||
* @var System $systemStats | ||
*/ | ||
$systemStats = yield $beanstalk->getSystemStats(); | ||
echo "Active connections: {$systemStats->currentConnections}\n"; | ||
echo "Jobs ready: {$systemStats->currentJobsReady}\n"; | ||
/** | ||
* @var System $systemStats | ||
*/ | ||
Comment on lines
+10
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't need such comments any longer, because we use proper types instead of generics inside promises. |
||
$systemStats = $beanstalk->getSystemStats(); | ||
echo "Active connections: $systemStats->currentConnections\n"; | ||
echo "Jobs ready: $systemStats->currentJobsReady\n"; | ||
|
||
$beanstalk->quit(); | ||
}); | ||
$beanstalk->quit(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="./vendor/autoload.php" colors="true"> | ||
<phpunit colors="true"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this now automatically included? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't recall a time when it was not. PHPUnit should be launched with |
||
<testsuites> | ||
<testsuite name="Tests"> | ||
<directory>./test</directory> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use our shared config in
amphp/php-cs-fixer-config:^2
, see https://github.com/amphp/amp/blob/d048ec1d03d47fc313d630e989b7a73053f10fae/.php-cs-fixer.dist.phpThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be that as it may, I do not think this issue needs to hold up this PR, nor even the 1.0 release, since styles can just be fixed after the fact.