Skip to content

Commit

Permalink
Update dependencies (#405)
Browse files Browse the repository at this point in the history
* Improve SymfonyConfigurationVariableService: resolve env variables in parameter values

* Improve SymfonyConfigurationVariableService test

* Improve SymfonyConfigurationVariableService class and its test

* - Remove PHP 8.0 support
- Prepare for PHPUnit 10
- Add Doctrine DBAL support for Laravel 11
- Update some dependencies

* Add license info for Laravel PDO classes
  • Loading branch information
lifinsky authored Nov 4, 2024
1 parent 2a81e4a commit 389c355
Show file tree
Hide file tree
Showing 107 changed files with 782 additions and 301 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.0', '8.3' ]
php-versions: [ '8.1', '8.3' ]
stability: [prefer-stable]
services:
rabbitmq:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
use Monorepo\ExampleApp\Symfony\Kernel;
use PHPUnit\Framework\TestCase;
use Monorepo\CrossModuleTests\Fixture\FailureHandler\ExampleFailureCommandHandler;
use Test\Ecotone\Amqp\AmqpMessagingTest;
use Test\Ecotone\Amqp\AmqpMessagingTestCase;
use Test\Ecotone\Dbal\DbalMessagingTestCase;
use Test\Ecotone\Sqs\AbstractConnectionTest;
use Test\Ecotone\Sqs\ConnectionTestCase;

final class MessageChannelConfigurationTest extends TestCase
{
Expand Down Expand Up @@ -146,7 +146,7 @@ function() {
yield "amqp" => [
AmqpBackedMessageChannelBuilder::create(self::CHANNEL_NAME)
->withReceiveTimeout(100),
[AmqpConnectionFactory::class => AmqpMessagingTest::getRabbitConnectionFactory()],
[AmqpConnectionFactory::class => AmqpMessagingTestCase::getRabbitConnectionFactory()],
ModulePackageList::allPackagesExcept([ModulePackageList::AMQP_PACKAGE, ModulePackageList::ASYNCHRONOUS_PACKAGE]),
function() {
MessagingTestCase::cleanRabbitMQ();
Expand All @@ -155,7 +155,7 @@ function() {
yield "redis" => [
RedisBackedMessageChannelBuilder::create(self::CHANNEL_NAME)
->withReceiveTimeout(100),
[RedisConnectionFactory::class => \Test\Ecotone\Redis\AbstractConnectionTest::getConnection()],
[RedisConnectionFactory::class => \Test\Ecotone\Redis\ConnectionTestCase::getConnection()],
ModulePackageList::allPackagesExcept([ModulePackageList::REDIS_PACKAGE, ModulePackageList::ASYNCHRONOUS_PACKAGE]),
function() {
MessagingTestCase::cleanUpRedis();
Expand All @@ -164,7 +164,7 @@ function() {
yield "sqs" => [
SqsBackedMessageChannelBuilder::create(self::CHANNEL_NAME)
->withReceiveTimeout(100),
[SqsConnectionFactory::class => AbstractConnectionTest::getConnection()],
[SqsConnectionFactory::class => ConnectionTestCase::getConnection()],
ModulePackageList::allPackagesExcept([ModulePackageList::SQS_PACKAGE, ModulePackageList::ASYNCHRONOUS_PACKAGE]),
function() {
MessagingTestCase::cleanUpSqs();
Expand Down
8 changes: 4 additions & 4 deletions Monorepo/CrossModuleTests/Tests/MessagingTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Ecotone\Dbal\Deduplication\DeduplicationInterceptor;
use Ecotone\Dbal\DocumentStore\DbalDocumentStore;
use Ecotone\Dbal\Recoverability\DbalDeadLetterHandler;
use Test\Ecotone\Amqp\AmqpMessagingTest;
use Test\Ecotone\Amqp\AmqpMessagingTestCase;
use Test\Ecotone\Dbal\DbalMessagingTestCase;

final class MessagingTestCase
Expand All @@ -26,7 +26,7 @@ public static function cleanUpDbal(): void
public static function cleanRabbitMQ(): void
{
self::cleanUpDbal();
$context = AmqpMessagingTest::getRabbitConnectionFactory()->createContext();
$context = AmqpMessagingTestCase::getRabbitConnectionFactory()->createContext();

foreach (['async'] as $queue) {
try {
Expand All @@ -38,7 +38,7 @@ public static function cleanRabbitMQ(): void
public static function cleanUpSqs(): void
{
self::cleanUpDbal();
$context = \Test\Ecotone\Sqs\AbstractConnectionTest::getConnection()->createContext();
$context = \Test\Ecotone\Sqs\ConnectionTestCase::getConnection()->createContext();

foreach (['async'] as $queue) {
try {
Expand All @@ -50,7 +50,7 @@ public static function cleanUpSqs(): void
public static function cleanUpRedis(): void
{
self::cleanUpDbal();
$context = \Test\Ecotone\Redis\AbstractConnectionTest::getConnection()->createContext();
$context = \Test\Ecotone\Redis\ConnectionTestCase::getConnection()->createContext();

foreach (['async'] as $queue) {
try {
Expand Down
8 changes: 4 additions & 4 deletions Monorepo/CrossModuleTests/Tests/ProxyCacheGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ProxyCacheGenerationTest extends FullAppBenchmarkCase
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function TODO_test_symfony_prod()
public function test_symfony_prod()
{
$this->markTestSkipped('grpc warning to be solved: https://github.com/google-ai-edge/mediapipe/issues/5371#issuecomment-2219871932');

Expand All @@ -27,7 +27,7 @@ public function TODO_test_symfony_prod()
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function TODO_test_laravel_prod(): void
public function test_laravel_prod(): void
{
$this->markTestSkipped('grpc warning to be solved: https://github.com/google-ai-edge/mediapipe/issues/5371#issuecomment-2219871932');

Expand All @@ -39,7 +39,7 @@ public function TODO_test_laravel_prod(): void
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function TODO_test_lite_application_prod()
public function test_lite_application_prod()
{
$this->markTestSkipped('grpc warning to be solved: https://github.com/google-ai-edge/mediapipe/issues/5371#issuecomment-2219871932');

Expand All @@ -51,7 +51,7 @@ public function TODO_test_lite_application_prod()
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function TODO_test_lite_prod()
public function test_lite_prod()
{
$this->markTestSkipped('grpc warning to be solved: https://github.com/google-ai-edge/mediapipe/issues/5371#issuecomment-2219871932');

Expand Down
6 changes: 3 additions & 3 deletions Monorepo/CrossModuleTests/Tests/Tracing/TracingStackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Monorepo\ExampleApp\ExampleAppCaseTrait;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use Psr\Container\ContainerInterface;
use Test\Ecotone\OpenTelemetry\Integration\TracingTest;
use Test\Ecotone\OpenTelemetry\Integration\TracingTestCase;

final class TracingStackTest extends FullAppTestCase
{
Expand Down Expand Up @@ -117,7 +117,7 @@ private function placeOrder(mixed $commandBus, Configuration $configuration): vo

private function assertTracing(InMemoryExporter $exporter): void
{
TracingTest::compareTreesByDetails(
TracingTestCase::compareTreesByDetails(
[
[
'details' => ['name' => 'Command Bus'],
Expand Down Expand Up @@ -160,7 +160,7 @@ private function assertTracing(InMemoryExporter $exporter): void
]
]
],
TracingTest::buildTree($exporter)
TracingTestCase::buildTree($exporter)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use OpenTelemetry\API\Trace\TracerProviderInterface;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use Psr\Log\LoggerInterface;
use Test\Ecotone\OpenTelemetry\Integration\TracingTest;
use Test\Ecotone\OpenTelemetry\Integration\TracingTestCase;

class AppServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -68,7 +68,7 @@ public function register(): void
$this->app->singleton(InMemoryExporter::class, fn() => new InMemoryExporter());
$this->app->singleton(TracerProviderInterface::class, function (Application $app) {
$exporter = $app->make(InMemoryExporter::class);
return TracingTest::prepareTracer($exporter);
return TracingTestCase::prepareTracer($exporter);
});
}

Expand Down
5 changes: 2 additions & 3 deletions Monorepo/ExampleApp/Lite/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
use Monorepo\ExampleApp\Common\Infrastructure\StubNotificationSender;
use Monorepo\ExampleApp\Common\Infrastructure\StubShippingService;
use Monorepo\ExampleApp\Common\Infrastructure\SystemClock;
use OpenTelemetry\API\Trace\TracerInterface;
use OpenTelemetry\API\Trace\TracerProviderInterface;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use Test\Ecotone\OpenTelemetry\Integration\TracingTest;
use Test\Ecotone\OpenTelemetry\Integration\TracingTestCase;

return function (bool $useCachedVersion = true): ConfiguredMessagingSystem {
$output = new Output();
Expand All @@ -51,7 +50,7 @@
InMemoryProductRepository::class => $configuration->productRepository(),
InMemoryUserRepository::class => $configuration->userRepository(),
InMemoryExporter::class => $exporter,
TracerProviderInterface::class => TracingTest::prepareTracer($exporter)
TracerProviderInterface::class => TracingTestCase::prepareTracer($exporter)
];
return EcotoneLite::bootstrap(
containerOrAvailableServices: $services,
Expand Down
4 changes: 2 additions & 2 deletions Monorepo/ExampleApp/LiteApplication/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Monorepo\ExampleApp\Common\Infrastructure\SystemClock;
use OpenTelemetry\API\Trace\TracerProviderInterface;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use Test\Ecotone\OpenTelemetry\Integration\TracingTest;
use Test\Ecotone\OpenTelemetry\Integration\TracingTestCase;

return function (bool $useCachedVersion = true): ConfiguredMessagingSystem {
$output = new Output();
Expand All @@ -44,7 +44,7 @@
Output::class => $output,
ErrorChannelService::class => new ErrorChannelService(),
InMemoryExporter::class => $exporter,
TracerProviderInterface::class => TracingTest::prepareTracer($exporter)
TracerProviderInterface::class => TracingTestCase::prepareTracer($exporter)
];

return EcotoneLiteApplication::bootstrap(
Expand Down
5 changes: 2 additions & 3 deletions Monorepo/ExampleApp/Symfony/config/services.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

use Ecotone\Messaging\Config\ModulePackageList;
use Monorepo\ExampleApp\Common\Domain\Product\ProductRepository;
use Monorepo\ExampleApp\Common\Domain\User\UserRepository;
use Monorepo\ExampleApp\Common\Infrastructure\Authentication\AuthenticationService;
Expand All @@ -9,7 +8,7 @@
use OpenTelemetry\API\Trace\TracerProviderInterface;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Test\Ecotone\OpenTelemetry\Integration\TracingTest;
use Test\Ecotone\OpenTelemetry\Integration\TracingTestCase;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

return static function (ContainerConfigurator $containerConfigurator): void {
Expand Down Expand Up @@ -38,7 +37,7 @@
$services->set(InMemoryExporter::class, InMemoryExporter::class)
->public();
$services->set(TracerProviderInterface::class)
->factory([TracingTest::class, 'prepareTracer'])
->factory([TracingTestCase::class, 'prepareTracer'])
->args([service(InMemoryExporter::class)])
->public();
};
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@
}
},
"require": {
"php": "^8.0",
"php": "^8.1",
"doctrine/dbal": "^2.12.0|^3.0",
"doctrine/persistence": "^2.5",
"doctrine/persistence": "^2.5|^3.4",
"enqueue/amqp-ext": "^0.10.18",
"enqueue/dbal": "^0.10.17",
"enqueue/redis": "^0.10.9",
Expand All @@ -139,13 +139,13 @@
},
"require-dev": {
"behat/behat": "^3.10",
"doctrine/annotations": "^1.13",
"doctrine/cache": "^1.0.0",
"doctrine/annotations": "^1.13|^2.0",
"doctrine/cache": "^1.0.0|^2.0",
"doctrine/orm": "^2.11|^3.0",
"friends-of-behat/symfony-extension": "<=2.4.2|^2.5",
"friendsofphp/php-cs-fixer": "^3.9",
"guzzlehttp/psr7": "^2.0",
"orchestra/testbench": "^7.6|^8.0",
"orchestra/testbench": "^7.6|^8.0|^9.0",
"php-coveralls/php-coveralls": "^2.5",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^9.6",
Expand All @@ -157,7 +157,7 @@
"symfony/amqp-messenger": "^5.4.31|^6.0|^7.0",
"symfony/doctrine-messenger": "^5.4|^6.0|^7.0",
"doctrine/doctrine-bundle": "^2.7.2",
"phpbench/phpbench": "^1.2",
"phpbench/phpbench": "^1.2|^1.3",
"enqueue/null": "^0.10.18",
"open-telemetry/transport-grpc": "^1.0.0",
"open-telemetry/exporter-otlp": "^1.0.0",
Expand Down
30 changes: 1 addition & 29 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
app:
image: simplycodedsoftware/php:8.3.10
image: simplycodedsoftware/php:8.3.13
volumes:
- "$PWD:/data/app"
working_dir: "/data/app"
Expand Down Expand Up @@ -57,34 +57,6 @@ services:
APP_MERGE_PLUGIN: "yes"
env_file:
- ".env"
app8_0:
image: simplycodedsoftware/nginx-php:8.0.30
volumes:
- "$PWD:/data/app"
working_dir: "/data/app"
command: sleep 99999
container_name: "ecotone_development_8_0"
user: "${USER_PID:-1000}:${USER_PID:-1000}"
extra_hosts:
- "host.docker.internal:host-gateway"
# 172.17.0.1
environment:
COMPOSER_HOME: /data/app
COMPOSE_HTTP_TIMEOUT: 9999
COMPOSER_ROOT_VERSION: 'dev-main'
RABBIT_HOST: "amqp://rabbitmq:5672"
DATABASE_DSN: pgsql://ecotone:secret@database:5432/ecotone
SECONDARY_DATABASE_DSN: mysql://ecotone:secret@database-mysql:3306/ecotone
APP_DB_HOST: database
APP_DB_PORT: 5432
APP_DB_DRIVER: pdo_pgsql
DATABASE_MYSQL: mysql://ecotone:secret@database-mysql:3306/ecotone
SQS_DSN: sqs:?key=key&secret=secret&region=us-east-1&endpoint=http://localstack:4566&version=latest
REDIS_DSN: redis://redis:6379
KAFKA_DSN: kafka:9092
APP_MERGE_PLUGIN: "yes"
env_file:
- ".env"
database:
image: simplycodedsoftware/postgres:16.1
environment:
Expand Down
2 changes: 1 addition & 1 deletion packages/Amqp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpstan/phpstan": "^1.8",
"doctrine/annotations": "^1.13",
"doctrine/annotations": "^1.13|^2.0",
"wikimedia/composer-merge-plugin": "^2.1"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* licence Apache-2.0
*/
abstract class AmqpMessagingTest extends TestCase
abstract class AmqpMessagingTestCase extends TestCase
{
public const RABBITMQ_HOST = 'localhost';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Ecotone\Messaging\PollableChannel;
use Ecotone\Messaging\Support\MessageBuilder;
use Enqueue\AmqpExt\AmqpConnectionFactory;
use Test\Ecotone\Amqp\AmqpMessagingTest;
use Test\Ecotone\Amqp\AmqpMessagingTestCase;

/**
* Class AmqpModuleTest
Expand All @@ -34,7 +34,7 @@
* licence Apache-2.0
* @internal
*/
class AmqpModuleTest extends AmqpMessagingTest
class AmqpModuleTestCase extends AmqpMessagingTestCase
{
public function test_registering_amqp_backed_message_channel()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use Ramsey\Uuid\Uuid;
use RuntimeException;
use stdClass;
use Test\Ecotone\Amqp\AmqpMessagingTest;
use Test\Ecotone\Amqp\AmqpMessagingTestCase;
use Test\Ecotone\Amqp\Fixture\AmqpConsumer\AmqpConsumerExample;
use Test\Ecotone\Amqp\Fixture\Handler\ExceptionalMessageHandler;

Expand All @@ -56,7 +56,7 @@
* licence Apache-2.0
* @internal
*/
class AmqpChannelAdapterTest extends AmqpMessagingTest
class AmqpChannelAdapterTestCase extends AmqpMessagingTestCase
{
public function setUp(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Enqueue\AmqpExt\AmqpConnectionFactory;
use Interop\Amqp\Impl\AmqpQueue;
use Ramsey\Uuid\Uuid;
use Test\Ecotone\Amqp\AmqpMessagingTest;
use Test\Ecotone\Amqp\AmqpMessagingTestCase;
use Test\Ecotone\Amqp\Fixture\DeadLetter\ErrorConfigurationContext;
use Test\Ecotone\Amqp\Fixture\Order\OrderService;

Expand All @@ -30,7 +30,7 @@
* licence Apache-2.0
* @internal
*/
final class AmqpMessageChannelTest extends AmqpMessagingTest
final class AmqpMessageChannelTestCase extends AmqpMessagingTestCase
{
public function test_sending_and_receiving_message_from_amqp_message_channel()
{
Expand Down
Loading

0 comments on commit 389c355

Please sign in to comment.