Skip to content

Commit 0078a8c

Browse files
committed
Run tests only with a single http client
1 parent 94930b9 commit 0078a8c

File tree

4 files changed

+9
-174
lines changed

4 files changed

+9
-174
lines changed

.github/workflows/meilisearch-beta-tests.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
tests:
2828
runs-on: ubuntu-latest
2929
needs: ['meilisearch-version']
30-
name: integration-tests-against-rc (PHP ${{ matrix.php-version }}) (${{ matrix.http-client }})
30+
name: integration-tests-against-rc (PHP ${{ matrix.php-version }})
3131
services:
3232
meilisearch:
3333
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
@@ -39,14 +39,6 @@ jobs:
3939
strategy:
4040
matrix:
4141
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
42-
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
43-
exclude:
44-
- php-version: '7.4'
45-
http-client: 'Symfony-HttpClient'
46-
- php-version: '8.0'
47-
http-client: 'Symfony-HttpClient'
48-
- php-version: '8.1'
49-
http-client: 'Symfony-HttpClient'
5042

5143
steps:
5244
- name: Checkout code
@@ -60,29 +52,6 @@ jobs:
6052
- name: Validate composer.json and composer.lock
6153
run: composer validate
6254

63-
- name: Switch to Guzzle7 Adapter
64-
if: matrix.http-client == 'Guzzle-7-Adapter'
65-
run: |
66-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle7-adapter": "^1.0.0",/' composer.json
67-
68-
- name: Switch to Symfony HttpClient
69-
if: matrix.http-client == 'Symfony-HttpClient'
70-
run: |
71-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"symfony\/http-client": "^7.1.1",/' composer.json
72-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
73-
74-
- name: Switch to PHP HTTP CurlClient
75-
if: matrix.http-client == 'PHP-HTTP-CurlClient'
76-
run: |
77-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/curl-client": "^2.3.2",/' composer.json
78-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
79-
80-
- name: Switch to Kriswallsmith Buzz
81-
if: matrix.http-client == 'Kriswallsmith-Buzz'
82-
run: |
83-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"kriswallsmith\/buzz": "^1.2.1",/' composer.json
84-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
85-
8655
- name: Install dependencies
8756
uses: ramsey/composer-install@v3
8857

.github/workflows/pre-release-tests.yml

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,7 @@ jobs:
3939
strategy:
4040
matrix:
4141
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
42-
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
43-
exclude:
44-
- php-version: '7.4'
45-
http-client: 'Symfony-HttpClient'
46-
- php-version: '8.0'
47-
http-client: 'Symfony-HttpClient'
48-
- php-version: '8.1'
49-
http-client: 'Symfony-HttpClient'
42+
5043
steps:
5144
- name: Checkout code
5245
uses: actions/checkout@v4
@@ -60,67 +53,8 @@ jobs:
6053
- name: Validate composer.json and composer.lock
6154
run: composer validate
6255

63-
- name: Switch to Guzzle7 Adapter
64-
if: matrix.http-client == 'Guzzle-7-Adapter'
65-
run: |
66-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle7-adapter": "^1.0.0",/' composer.json
67-
68-
- name: Switch to Symfony HttpClient
69-
if: matrix.http-client == 'Symfony-HttpClient'
70-
run: |
71-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"symfony\/http-client": "^7.1.1",/' composer.json
72-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
73-
74-
- name: Switch to PHP HTTP CurlClient
75-
if: matrix.http-client == 'PHP-HTTP-CurlClient'
76-
run: |
77-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/curl-client": "^2.3.2",/' composer.json
78-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
79-
80-
- name: Switch to Kriswallsmith Buzz
81-
if: matrix.http-client == 'Kriswallsmith-Buzz'
82-
run: |
83-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"kriswallsmith\/buzz": "^1.2.1",/' composer.json
84-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
85-
8656
- name: Install dependencies
8757
uses: ramsey/composer-install@v3
8858

8959
- name: Run test suite
9060
run: sh scripts/tests.sh
91-
92-
test_php_7_guzzle_6:
93-
runs-on: ubuntu-latest
94-
needs: ['meilisearch-version']
95-
name: integration-tests-against-rc (PHP 7.4 & Guzzle 6)
96-
services:
97-
meilisearch:
98-
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
99-
env:
100-
MEILI_MASTER_KEY: 'masterKey'
101-
MEILI_NO_ANALYTICS: 'true'
102-
ports:
103-
- '7700:7700'
104-
105-
steps:
106-
- name: Checkout code
107-
uses: actions/checkout@v4
108-
109-
- name: Install PHP
110-
uses: shivammathur/setup-php@v2
111-
with:
112-
php-version: '7.4'
113-
coverage: none
114-
115-
- name: Validate composer.json and composer.lock
116-
run: composer validate
117-
118-
- name: Switch to Guzzle 6
119-
run: |
120-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle6-adapter": "^2.0.2",/' composer.json
121-
122-
- name: Install dependencies
123-
uses: ramsey/composer-install@v3
124-
125-
- name: Run test suite - php-http/guzzle6-adapter
126-
run: sh scripts/tests.sh

.github/workflows/tests.yml

Lines changed: 3 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
# Will still run for each push to bump-meilisearch-v*
6969
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
7070
runs-on: ubuntu-latest
71-
name: integration-tests (PHP ${{ matrix.php-version }}) (${{ matrix.http-client }})
71+
name: integration-tests (PHP ${{ matrix.php-version }})
7272
services:
7373
meilisearch:
7474
image: getmeili/meilisearch:latest
@@ -80,14 +80,6 @@ jobs:
8080
strategy:
8181
matrix:
8282
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
83-
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
84-
exclude:
85-
- php-version: '7.4'
86-
http-client: 'Symfony-HttpClient'
87-
- php-version: '8.0'
88-
http-client: 'Symfony-HttpClient'
89-
- php-version: '8.1'
90-
http-client: 'Symfony-HttpClient'
9183

9284
steps:
9385
- uses: actions/checkout@v4
@@ -101,79 +93,18 @@ jobs:
10193
- name: Validate composer.json and composer.lock
10294
run: composer validate
10395

104-
- name: Switch to Guzzle7 Adapter
105-
if: matrix.http-client == 'Guzzle-7-Adapter'
106-
run: |
107-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle7-adapter": "^1.0.0",/' composer.json
108-
109-
- name: Switch to Symfony HttpClient
110-
if: matrix.http-client == 'Symfony-HttpClient'
111-
run: |
112-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"symfony\/http-client": "^7.1.1",/' composer.json
113-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
114-
115-
- name: Switch to PHP HTTP CurlClient
116-
if: matrix.http-client == 'PHP-HTTP-CurlClient'
117-
run: |
118-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/curl-client": "^2.3.2",/' composer.json
119-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
120-
121-
- name: Switch to Kriswallsmith Buzz
122-
if: matrix.http-client == 'Kriswallsmith-Buzz'
123-
run: |
124-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"kriswallsmith\/buzz": "^1.2.1",/' composer.json
125-
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
126-
12796
- name: Install dependencies
12897
uses: ramsey/composer-install@v3
12998

13099
- name: Run test suite
131-
run: sh scripts/tests.sh --coverage-clover coverage-${{ matrix.php-version }}-${{ matrix.http-client }}.xml
100+
run: sh scripts/tests.sh --coverage-clover coverage-${{ matrix.php-version }}.xml
132101

133102
- name: Upload coverage file
134103
uses: actions/upload-artifact@v4
135104
with:
136-
name: 'phpunit-${{ matrix.php-version }}-${{ matrix.http-client }}-coverage'
105+
name: 'phpunit-${{ matrix.php-version }}-coverage'
137106
path: 'coverage*.xml'
138107

139-
test_php_7_guzzle_6:
140-
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
141-
# Will still run for each push to bump-meilisearch-v*
142-
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
143-
runs-on: ubuntu-latest
144-
services:
145-
meilisearch:
146-
image: getmeili/meilisearch:latest
147-
ports:
148-
- 7700:7700
149-
env:
150-
MEILI_MASTER_KEY: masterKey
151-
MEILI_NO_ANALYTICS: true
152-
153-
name: integration-tests (PHP 7.4 & Guzzle 6)
154-
steps:
155-
- name: Checkout code
156-
uses: actions/checkout@v4
157-
158-
- name: Install PHP
159-
uses: shivammathur/setup-php@v2
160-
with:
161-
php-version: '7.4'
162-
coverage: none
163-
164-
- name: Validate composer.json and composer.lock
165-
run: composer validate
166-
167-
- name: Switch to Guzzle 6
168-
run: |
169-
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle6-adapter": "^2.0.2",/' composer.json
170-
171-
- name: Install dependencies
172-
uses: ramsey/composer-install@v3
173-
174-
- name: Run test suite - php-http/guzzle6-adapter
175-
run: sh scripts/tests.sh
176-
177108
upload-coverage:
178109
name: Upload coverage to Codecov
179110
runs-on: ubuntu-latest

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@
3737
},
3838
"suggest": {
3939
"guzzlehttp/guzzle": "Use Guzzle ^7 as HTTP client",
40-
"http-interop/http-factory-guzzle": "Factory for guzzlehttp/guzzle"
40+
"http-interop/http-factory-guzzle": "Factory for guzzlehttp/guzzle",
41+
"symfony/http-client": "Use Symfony Http client"
4142
},
4243
"require-dev": {
4344
"phpunit/phpunit": "^9.5 || ^10.5",
4445
"php-cs-fixer/shim": "^3.59.3",
45-
"guzzlehttp/guzzle": "^7.8.1",
4646
"http-interop/http-factory-guzzle": "^1.2.0",
4747
"phpstan/phpstan": "^2.0",
4848
"phpstan/phpstan-phpunit": "^2.0",
4949
"phpstan/phpstan-deprecation-rules": "^2.0",
50-
"phpstan/phpstan-strict-rules": "^2.0"
50+
"phpstan/phpstan-strict-rules": "^2.0",
51+
"symfony/http-client": "^5.4|^6.0|^7.0"
5152
},
5253
"scripts": {
5354
"lint": [

0 commit comments

Comments
 (0)