Skip to content
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
18 changes: 3 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
sed -i -re 's/"require": \{/"repositories": [{"type": "path","url": "..\/..\/Core", "options": {"versions": {"async-aws\/core": "dev-master"}}, "canonical": ${{matrix.strategy != 'lowest' && 'true' || 'false'}} }],"require": \{/' composer.json
composer config minimum-stability dev
composer config prefer-stable true
composer require --dev --no-update symfony/phpunit-bridge:^7.3.2
cat composer.json

echo ::endgroup::
Expand All @@ -71,7 +70,6 @@ jobs:
echo "$CURRENT_DIR/$COMPONENT"
cd "$CURRENT_DIR/$COMPONENT"

sed -i -re 's/"require": \{/"conflict": \{"phpunit\/phpunit": ">=10.0"\},"require": \{/' composer.json
composer config minimum-stability dev
composer config prefer-stable true
cat composer.json
Expand All @@ -93,9 +91,7 @@ jobs:
cd "$CURRENT_DIR/$COMPONENT"

localExit=0
composer require symfony/phpunit-bridge:^7.3.2@dev --dev --no-update --no-install
composer update --no-interaction --no-scripts --prefer-dist --optimize-autoloader ${{ matrix.strategy == 'lowest' && '--prefer-lowest' || '' }} $COMPOSER_OPTIONS || localExit=1
./vendor/bin/simple-phpunit install
echo ::endgroup::
if [ $localExit -ne 0 ]; then
echo "::error::$COMPONENT error"
Expand All @@ -105,19 +101,16 @@ jobs:

- name: Run tests
env:
OVERRIDE_SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.strategy == 'lowest' && 'max[self]=9999' || '' }}
PHPUNIT_FLAGS: ${{ matrix.strategy == 'lowest' && '--do-not-fail-on-deprecation' || '' }}
run: |
ok=0
if [ -n "$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER" ]; then
export SYMFONY_DEPRECATIONS_HELPER=$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER
fi
CURRENT_DIR=$(pwd)
for COMPONENT in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$COMPONENT
localExit=0
cd "$CURRENT_DIR/$COMPONENT"
./vendor/bin/simple-phpunit 2>&1 || localExit=1
./vendor/bin/phpunit $PHPUNIT_FLAGS 2>&1 || localExit=1
ok=$(( $localExit || $ok ))
echo ::endgroup::
if [ $localExit -ne 0 ]; then
Expand Down Expand Up @@ -163,12 +156,7 @@ jobs:
- name: Download dependencies
run: |
composer config minimum-stability ${{ matrix.minimum_stability }}
composer require --dev --no-update "phpunit/phpunit=9.6.*"
composer update --no-interaction --prefer-dist --optimize-autoloader

- name: Run tests
run: |
echo ::group::Install
./vendor/bin/simple-phpunit install
echo ::endgroup::
./vendor/bin/simple-phpunit
run: ./vendor/bin/phpunit
8 changes: 2 additions & 6 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ jobs:
restore-keys: phpstan-

- name: Download dependencies
run: |
composer update --no-interaction --prefer-dist --optimize-autoloader
./vendor/bin/simple-phpunit install
run: composer update --no-interaction --prefer-dist --optimize-autoloader

- name: PHPStan
run: vendor/bin/phpstan analyze --no-progress
Expand Down Expand Up @@ -104,9 +102,7 @@ jobs:
restore-keys: composer-

- name: Download dependencies
run: |
composer update --no-interaction --prefer-dist --optimize-autoloader
./vendor/bin/simple-phpunit install
run: composer update --no-interaction --prefer-dist --optimize-autoloader

- name: Psalm
run: vendor/bin/psalm.phar --no-progress --show-info=false --stats
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ stop-docker:
docker rm async_aws_kms || true

test: initialize
./vendor/bin/simple-phpunit
./vendor/bin/phpunit

website-assets: website/template/assets/app.css
website/template/assets/app.css: website/node_modules website/assets/*
Expand Down
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"illuminate/cache": "^6.18.13 || ^7.10 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/queue": "^6.18.11 || ^7.10 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^6.18.13 || ^7.10 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
"matthiasnoback/symfony-config-test": "^4.1 || ^5.0",
"matthiasnoback/symfony-config-test": "^6.1",
"monolog/monolog": "^1.1 || ^2.0 || ^3.0",
"nette/php-generator": "^3.6 || ^4.1",
"nette/utils": "^3.0 || ^4.0",
"nikic/php-parser": "^4.0",
"nyholm/symfony-bundle-test": "^3.0",
"phpstan/phpstan": "~2.0.0",
"phpunit/phpunit": "^11.5.42",
"psalm/phar": "~6.13.1",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"swaggest/json-diff": "^3.7",
Expand All @@ -36,14 +36,16 @@
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/deprecation-contracts": "^2.1 || ^3.0",
"symfony/error-handler": "^7.3.2 || ^8.0",
"symfony/filesystem": "^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/finder": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/framework-bundle": "^5.4.45 || ^6.4.13 || ^7.1.6",
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/phpunit-bridge": "^5.3 || ^6.0 || ^7.0 || ^8.0",
"symfony/polyfill-uuid": "^1.13.1"
"symfony/phpunit-bridge": "^7.3.2 || ^8.0",
"symfony/polyfill-uuid": "^1.13.1",
"symfony/runtime": "^7.3.2 || ^8.0"
},
"conflict": {
"phpunit/phpunit": ">=10",
"symfony/http-client": "5.2.0"
},
"autoload": {
Expand Down Expand Up @@ -156,7 +158,8 @@
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
"ergebnis/composer-normalize": true,
"symfony/runtime": false
}
}
}
19 changes: 17 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
failOnDeprecation="true"
failOnNotice="true"
>
<source ignoreSuppressionOfDeprecations="true" ignoreIndirectDeprecations="true">
<include>
<directory>./src</directory>
</include>
<exclude>
<directory>./src/Core/tests/</directory>
<directory>./src/Service/*/tests/</directory>
<directory>./src/Integration/*/tests/</directory>
<directory>./src/Integration/*/*/tests/</directory>
</exclude>
<deprecationTrigger>
<function>trigger_deprecation</function>
</deprecationTrigger>
</source>
<php>
<ini name="error_reporting" value="-1"/>
<env name="AWS_SHARED_CREDENTIALS_FILE" value="/dev/null" />
<env name="AWS_CONFIG_FILE" value="/dev/null" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;quiet[]=indirect" />
</php>
<testsuites>
<testsuite name="Test Suite">
Expand Down
4 changes: 0 additions & 4 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
</ignoreFiles>
</projectFiles>

<extraFiles>
<directory name="vendor/bin/.phpunit" />
</extraFiles>

<issueHandlers>
<LessSpecificReturnType errorLevel="info" />

Expand Down
3 changes: 1 addition & 2 deletions src/CodeGenerator/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
- name: Download dependencies
run: |
composer config minimum-stability dev
composer req symfony/phpunit-bridge --no-update
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable

- name: Run tests
run: ./vendor/bin/simple-phpunit
run: ./vendor/bin/phpunit
5 changes: 5 additions & 0 deletions src/CodeGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"symfony/service-contracts": "^2.0 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^11.5.42",
"symfony/error-handler": "^7.3.2 || ^8.0",
"symfony/phpunit-bridge": "^7.3.2 || ^8.0"
},
"autoload": {
"psr-4": {
"AsyncAws\\CodeGenerator\\": "src"
Expand Down
3 changes: 1 addition & 2 deletions src/Core/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ jobs:
- name: Download dependencies
run: |
composer config minimum-stability dev
composer req symfony/phpunit-bridge --no-update
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable

- name: Run tests
run: ./vendor/bin/simple-phpunit
run: ./vendor/bin/phpunit
2 changes: 1 addition & 1 deletion src/Core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ start-docker-s3:
docker run -d -p 4569:4569 -p 4570:4569 --name async_aws_s3 asyncaws/testing-s3

test: initialize
./vendor/bin/simple-phpunit
./vendor/bin/phpunit

clean: stop-docker
stop-docker:
Expand Down
5 changes: 5 additions & 0 deletions src/Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"symfony/http-client-contracts": "^1.1.8 || ^2.0 || ^3.0",
"symfony/service-contracts": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^11.5.42",
"symfony/error-handler": "^7.3.2 || ^8.0",
"symfony/phpunit-bridge": "^7.3.2 || ^8.0"
},
"conflict": {
"async-aws/s3": "<1.1",
"symfony/http-client": "5.2.0"
Expand Down
27 changes: 21 additions & 6 deletions src/Core/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" failOnRisky="true" failOnWarning="true">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
failOnDeprecation="true"
failOnNotice="true"
>
<source ignoreSuppressionOfDeprecations="true">
<include>
<directory>./src</directory>
</include>
<deprecationTrigger>
<function>trigger_deprecation</function>
</deprecationTrigger>
</source>
<php>
<ini name="error_reporting" value="-1"/>
</php>
Expand All @@ -8,9 +25,7 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src</directory>
</include>
</source>
<extensions>
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension"/>
</extensions>
</phpunit>
9 changes: 4 additions & 5 deletions src/Core/tests/HttpClient/AwsRetryStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@

use AsyncAws\Core\HttpClient\AwsRetryStrategy;
use AsyncAws\Core\Test\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\AsyncContext;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\HttpClient\Retry\GenericRetryStrategy;

class AwsRetryStrategyTest extends TestCase
{
/**
* @dataProvider provideRetries
*/
public function testShoudRetry(?bool $expected, int $statusCode, ?string $response): void
#[DataProvider('provideRetries')]
public function testShouldRetry(?bool $expected, int $statusCode, ?string $response): void
{
if (!class_exists(GenericRetryStrategy::class)) {
self::markTestSkipped('AwsRetryStrategy requires symfony/http-client 5.2');
Expand All @@ -25,7 +24,7 @@ public function testShoudRetry(?bool $expected, int $statusCode, ?string $respon
self::assertSame($expected, $strategy->shouldRetry($context, $response, null));
}

public function provideRetries(): iterable
public static function provideRetries(): iterable
{
yield [false, 200, null];
yield [true, 429, null];
Expand Down
7 changes: 3 additions & 4 deletions src/Core/tests/Unit/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
namespace AsyncAws\Core\Tests\Unit;

use AsyncAws\Core\Configuration;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class ConfigurationTest extends TestCase
{
/**
* @dataProvider provideConfiguration
*/
#[DataProvider('provideConfiguration')]
public function testCreate($config, $env, $expected)
{
foreach ($env as $key => $value) {
Expand Down Expand Up @@ -61,7 +60,7 @@ public function testIsDefaultWhenPassingNull()
self::assertNull($config->get('accessKeySecret'));
}

public function provideConfiguration(): iterable
public static function provideConfiguration(): iterable
{
yield 'simple config' => [['endpoint' => 'foo'], [], ['endpoint' => 'foo']];
yield 'empty config' => [['endpoint' => ''], [], ['endpoint' => '']];
Expand Down
9 changes: 3 additions & 6 deletions src/Core/tests/Unit/Signer/SignerV4Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use AsyncAws\Core\RequestContext;
use AsyncAws\Core\Signer\SignerV4;
use AsyncAws\Core\Stream\StringStream;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

class SignerV4Test extends TestCase
Expand Down Expand Up @@ -60,9 +61,7 @@ public function testPresign()
self::assertEqualsCanonicalizing($expectedQuery, $request->getQuery());
}

/**
* @dataProvider provideRequests
*/
#[DataProvider('provideRequests')]
public function testSignsRequests($rawRequest, $rawExpected)
{
$request = $this->parseRequest($rawRequest);
Expand Down Expand Up @@ -140,9 +139,7 @@ public static function provideRequests()
];
}

/**
* @dataProvider provideRequestsWithQueryParams
*/
#[DataProvider('provideRequestsWithQueryParams')]
public function testSignsRequestsWithArrayInQueryParams($rawRequestWithoutQuery, $rawExpected, $queryParams)
{
$request = $this->parseRequest($rawRequestWithoutQuery, $queryParams);
Expand Down
Loading
Loading