diff --git a/.github/workflows/test-components.yml b/.github/workflows/test-components.yml index e2b2dedad..d542b81f0 100644 --- a/.github/workflows/test-components.yml +++ b/.github/workflows/test-components.yml @@ -46,8 +46,7 @@ jobs: composer update -o - name: Run Test Cases run: | - composer analyse src - composer analyse:types + composer analyse src/trigger serializable-closure: name: Test for Laravel Serializable Closure runs-on: 'ubuntu-latest' @@ -76,8 +75,9 @@ jobs: composer update -o - name: Run Test Cases run: | - composer analyse src - composer analyse:types + composer analyse src/support + composer analyse:types types/Support + composer test:unit -- tests/Support/DispatchTest.php carbon: name: Test for Nesbot Carbon runs-on: 'ubuntu-latest' @@ -140,3 +140,37 @@ jobs: run: | composer analyse src composer analyse:types + elasticsearch: + name: Test for Elasticsearch + runs-on: 'ubuntu-latest' + env: + PHP_VERSION: ${{ matrix.php-version }} + strategy: + matrix: + php-version: [ '8.4', '8.3', '8.2' ] + elasticsearch-version: [ '^9.0', '^8.0' ] + max-parallel: 10 + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: phpize + extensions: redis, pdo, pdo_mysql, bcmath, swoole + ini-values: opcache.enable_cli=1 + coverage: none + - name: Setup Packages + run: | + composer require elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }} --no-update + composer update -o + - name: Run Test Cases + run: | + composer analyse src/elasticsearch + composer analyse src/sentry + composer analyse src/telescope-elasticsearch + composer analyse:types types/Sentry + composer test:unit -- --group=elasticsearch + composer test:unit -- --group=sentry diff --git a/composer.json b/composer.json index 3d8cc5956..e7720fda0 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,6 @@ "google/protobuf": "^3.21", "google/recaptcha": "^1.2", "guzzlehttp/uri-template": "^1.0", - "hyperf/elasticsearch": "~3.2.0", "krowinski/php-mysql-replication": "^8.0 || ^9.0", "laravel/serializable-closure": "^1.0 || ^2.0", "league/commonmark": "^1.3 || ^2.0.2", @@ -44,7 +43,7 @@ }, "require-dev": { "aws/aws-sdk-php": "^3.235.5", - "elasticsearch/elasticsearch": "^7.0 || ^8.0", + "elasticsearch/elasticsearch": "^8.0 || ^9.0", "ergebnis/composer-normalize": "^2.43", "hashids/hashids": "^4.1 || ^5.0", "huangdijia/php-coding-standard": "^2.4", diff --git a/src/elasticsearch/composer.json b/src/elasticsearch/composer.json index 573ff8f00..d1368d6db 100644 --- a/src/elasticsearch/composer.json +++ b/src/elasticsearch/composer.json @@ -21,7 +21,7 @@ "pull-request": "https://github.com/friendsofhyperf/components/pulls" }, "require": { - "elasticsearch/elasticsearch": "^8.0", + "elasticsearch/elasticsearch": "^8.0 || ^9.0", "hyperf/config": "~3.2.0", "hyperf/context": "~3.2.0", "hyperf/guzzle": "~3.2.0" diff --git a/src/sentry/composer.json b/src/sentry/composer.json index 1e9537ac9..e971121dc 100644 --- a/src/sentry/composer.json +++ b/src/sentry/composer.json @@ -36,7 +36,7 @@ "symfony/polyfill-php85": "^1.33" }, "suggest": { - "elasticsearch/elasticsearch": "Required to use the elasticsearch client (^7.0|^8.0).", + "elasticsearch/elasticsearch": "Required to use the elasticsearch client (^8.0 || ^9.0).", "hyperf/amqp": "Required to use the amqp event (~3.2.0).", "hyperf/crontab": "Required to use the crontab event (~3.2.0).", "hyperf/database": "Required to use the crontab event (~3.2.0).", diff --git a/src/sentry/src/Tracing/Aspect/ElasticsearchAspect.php b/src/sentry/src/Tracing/Aspect/ElasticsearchAspect.php index 08177576a..1b6aaa323 100644 --- a/src/sentry/src/Tracing/Aspect/ElasticsearchAspect.php +++ b/src/sentry/src/Tracing/Aspect/ElasticsearchAspect.php @@ -22,20 +22,7 @@ class ElasticsearchAspect extends AbstractAspect { public array $classes = [ - // v7.x - 'Elasticsearch\Client::bulk', - 'Elasticsearch\Client::count', - 'Elasticsearch\Client::create', - 'Elasticsearch\Client::get', - 'Elasticsearch\Client::getSource', - 'Elasticsearch\Client::index', - 'Elasticsearch\Client::mget', - 'Elasticsearch\Client::msearch', - 'Elasticsearch\Client::scroll', - 'Elasticsearch\Client::search', - 'Elasticsearch\Client::update', - 'Elasticsearch\Client::updateByQuery', - // v8.x + // v8.x+ 'Elastic\Elasticsearch\Traits\ClientEndpointsTrait::bulk', 'Elastic\Elasticsearch\Traits\ClientEndpointsTrait::count', 'Elastic\Elasticsearch\Traits\ClientEndpointsTrait::create', diff --git a/src/telescope-elasticsearch/composer.json b/src/telescope-elasticsearch/composer.json index a39ef27f5..730465f48 100644 --- a/src/telescope-elasticsearch/composer.json +++ b/src/telescope-elasticsearch/composer.json @@ -33,7 +33,7 @@ "hyperf/stringable": "~3.2.0" }, "suggest": { - "elasticsearch/elasticsearch": "Required to use Elasticsearch Client.(^7.17.0||^8.8.0)" + "elasticsearch/elasticsearch": "Required to use Elasticsearch Client (^8.0 || ^9.0)." }, "autoload": { "psr-4": {