Skip to content

Commit 9f94639

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/logger
2 parents 24cd697 + 772ee90 commit 9f94639

8 files changed

+90
-269
lines changed

.github/workflows/integration-test-cluster-neo4j-4.yml

Lines changed: 10 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -17,126 +17,14 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v2
20-
- name: Cache Composer dependencies
21-
uses: actions/cache@v2
20+
- name: Populate .env
21+
run: |
22+
echo "CONNECTION=neo4j://neo4j:testtest@neo4j" > .env
23+
- uses: hoverkraft-tech/[email protected]
2224
with:
23-
path: /tmp/composer-cache
24-
key: ${{ runner.os }}-8.0-${{ hashFiles('**/composer.lock') }}
25-
- uses: php-actions/composer@v6
26-
with:
27-
progress: yes
28-
php_version: 8.1
29-
version: 2
30-
- uses: php-actions/phpunit@v3
31-
with:
32-
configuration: phpunit.xml.dist
33-
php_version: 8.1
34-
memory_limit: 1024M
35-
version: 10
36-
testsuite: Integration
37-
bootstrap: vendor/autoload.php
38-
39-
services:
40-
core1:
41-
image: neo4j:4.4-enterprise
42-
options: >-
43-
--health-cmd "wget -q --method=HEAD http://localhost:7475 || exit 1"
44-
--health-start-period "60s"
45-
--health-interval "30s"
46-
--health-timeout "15s"
47-
--health-retries "5"
48-
ports:
49-
- 7688:7688
50-
- 7475:7475
51-
env:
52-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
53-
NEO4JLABS_PLUGINS: '["apoc"]'
54-
NEO4J_AUTH: neo4j/testtest
55-
NEO4J_dbms_mode: CORE
56-
NEO4J_causal__clustering_discovery__advertised__address: core1:5000
57-
NEO4J_causal__clustering_transaction__advertised__address: core1:6000
58-
NEO4J_causal__clustering_raft__advertised__address: core1:7000
59-
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
60-
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
61-
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
62-
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
63-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7475
64-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7688
65-
66-
core2:
67-
image: neo4j:4.4-enterprise
68-
options: >-
69-
--health-cmd "wget -q --method=HEAD http://localhost:7476 || exit 1"
70-
--health-start-period "60s"
71-
--health-interval "30s"
72-
--health-timeout "15s"
73-
--health-retries "5"
74-
ports:
75-
- 7689:7689
76-
- 7476:7476
77-
env:
78-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
79-
NEO4JLABS_PLUGINS: '["apoc"]'
80-
NEO4J_AUTH: neo4j/testtest
81-
NEO4J_dbms_mode: CORE
82-
NEO4J_causal__clustering_discovery__advertised__address: core2:5000
83-
NEO4J_causal__clustering_transaction__advertised__address: core2:6000
84-
NEO4J_causal__clustering_raft__advertised__address: core2:7000
85-
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
86-
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
87-
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
88-
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
89-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7476
90-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7689
91-
92-
core3:
93-
image: neo4j:4.4-enterprise
94-
options: >-
95-
--health-cmd "wget -q --method=HEAD http://localhost:7477 || exit 1"
96-
--health-start-period "60s"
97-
--health-interval "30s"
98-
--health-timeout "15s"
99-
--health-retries "5"
100-
ports:
101-
- 7690:7690
102-
- 7477:7477
103-
env:
104-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
105-
NEO4JLABS_PLUGINS: '["apoc"]'
106-
NEO4J_AUTH: neo4j/testtest
107-
NEO4J_dbms_mode: CORE
108-
NEO4J_causal__clustering_discovery__advertised__address: core3:5000
109-
NEO4J_causal__clustering_transaction__advertised__address: core3:6000
110-
NEO4J_causal__clustering_raft__advertised__address: core3:7000
111-
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
112-
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
113-
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
114-
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
115-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7477
116-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7690
117-
118-
readreplica1:
119-
image: neo4j:4.4-enterprise
120-
options: >-
121-
--health-cmd "wget -q --method=HEAD http://localhost:7478 || exit 1"
122-
--health-start-period "60s"
123-
--health-interval "30s"
124-
--health-timeout "15s"
125-
--health-retries "5"
126-
ports:
127-
- 7691:7691
128-
- 7478:7478
129-
env:
130-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
131-
NEO4JLABS_PLUGINS: '["apoc"]'
132-
NEO4J_AUTH: neo4j/testtest
133-
NEO4J_dbms_mode: READ_REPLICA
134-
NEO4J_causal__clustering_discovery__advertised__address: readreplica1:5000
135-
NEO4J_causal__clustering_transaction__advertised__address: readreplica1:6000
136-
NEO4J_causal__clustering_raft__advertised__address: readreplica1:7000
137-
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
138-
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
139-
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
140-
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
141-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7478
142-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7691
25+
compose-file: './docker-compose-neo4j-4.yml'
26+
up-flags: '--build'
27+
- name: Test
28+
run: |
29+
docker compose run client composer install
30+
docker compose run client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration

.github/workflows/integration-test-cluster-neo4j-5.yml

Lines changed: 10 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -17,107 +17,14 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v2
20-
- name: Cache Composer dependencies
21-
uses: actions/cache@v2
20+
- name: Populate .env
21+
run: |
22+
echo "CONNECTION=neo4j://neo4j:testtest@neo4j" > .env
23+
- uses: hoverkraft-tech/[email protected]
2224
with:
23-
path: /tmp/composer-cache
24-
key: ${{ runner.os }}-8.0-${{ hashFiles('**/composer.lock') }}
25-
- uses: php-actions/composer@v6
26-
with:
27-
progress: yes
28-
php_version: 8.1
29-
version: 2
30-
- uses: php-actions/phpunit@v3
31-
with:
32-
configuration: phpunit.xml.dist
33-
php_version: 8.1
34-
memory_limit: 1024M
35-
version: 10
36-
testsuite: Integration
37-
bootstrap: vendor/autoload.php
38-
39-
services:
40-
server1:
41-
image: neo4j:5.20-enterprise
42-
ports:
43-
- 7687:7687
44-
- 7473:7473
45-
- 7474:7474
46-
env:
47-
NEO4J_initial_server_mode__constraint: PRIMARY
48-
NEO4J_dbms_cluster_discovery_endpoints: server1:5000,server2:5000,server3:5000
49-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
50-
NEO4j_server_bolt_advertised_address: localhost:7687
51-
NEO4j_server_http_advertised_address: localhost:7474
52-
NEO4J_PLUGINS: '["apoc"]'
53-
NEO4J_AUTH: neo4j/testtest
54-
options: >-
55-
--hostname server1
56-
--health-cmd "wget -q --method=HEAD http://localhost:7474 || exit 1"
57-
--health-start-period "60s"
58-
--health-interval "30s"
59-
--health-timeout "15s"
60-
--health-retries "5"
61-
server2:
62-
image: neo4j:5.20-enterprise
63-
ports:
64-
- 8687:7687
65-
- 8473:7473
66-
- 8474:7474
67-
env:
68-
NEO4J_initial_server_mode__constraint: PRIMARY
69-
NEO4J_dbms_cluster_discovery_endpoints: server1:5000,server2:5000,server3:5000
70-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
71-
NEO4j_server_bolt_advertised_address: localhost:8687
72-
NEO4j_server_http_advertised_address: localhost:8474
73-
NEO4J_PLUGINS: '["apoc"]'
74-
NEO4J_AUTH: neo4j/testtest
75-
options: >-
76-
--hostname server2
77-
--health-cmd "wget -q --method=HEAD http://localhost:7474 || exit 1"
78-
--health-start-period "60s"
79-
--health-interval "30s"
80-
--health-timeout "15s"
81-
--health-retries "5"
82-
server3:
83-
image: neo4j:5.20-enterprise
84-
ports:
85-
- 9474:7474
86-
- 9473:7473
87-
- 9687:7687
88-
env:
89-
NEO4J_initial_server_mode__constraint: PRIMARY
90-
NEO4J_dbms_cluster_discovery_endpoints: server1:5000,server2:5000,server3:5000
91-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
92-
NEO4j_server_bolt_advertised_address: localhost:9687
93-
NEO4j_server_http_advertised_address: localhost:9474
94-
NEO4J_PLUGINS: '["apoc"]'
95-
NEO4J_AUTH: neo4j/testtest
96-
options: >-
97-
--hostname server3
98-
--health-cmd "wget -q --method=HEAD http://localhost:7474 || exit 1"
99-
--health-start-period "60s"
100-
--health-interval "30s"
101-
--health-timeout "15s"
102-
--health-retries "5"
103-
read-server4:
104-
image: neo4j:5.20-enterprise
105-
ports:
106-
- 10474:7474
107-
- 10473:7473
108-
- 10687:7687
109-
env:
110-
NEO4J_initial_server_mode__constraint: SECONDARY
111-
NEO4J_dbms_cluster_discovery_endpoints: server1:5000,server2:5000,server3:5000
112-
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
113-
NEO4j_server_bolt_advertised_address: localhost:10687
114-
NEO4j_server_http_advertised_address: localhost:10474
115-
NEO4J_PLUGINS: '["apoc"]'
116-
NEO4J_AUTH: neo4j/testtest
117-
options: >-
118-
--hostname read-server4
119-
--health-cmd "wget -q --method=HEAD http://localhost:7474 || exit 1"
120-
--health-start-period "60s"
121-
--health-interval "30s"
122-
--health-timeout "15s"
123-
--health-retries "5"
25+
compose-file: './docker-compose.yml'
26+
up-flags: '--build'
27+
- name: Test
28+
run: |
29+
docker compose run client composer install
30+
docker compose run client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration

.github/workflows/integration-test-single-server.yml

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,53 @@ on:
99
- main
1010

1111
jobs:
12-
tests:
12+
tests-v4:
1313
runs-on: ubuntu-latest
14-
name: "Running on PHP 8.2 with a Neo4j 5 instance connecting over all available protocols"
15-
16-
services:
17-
neo4j:
18-
image: neo4j:5
19-
env:
20-
NEO4J_AUTH: neo4j/testtest
21-
NEO4JLABS_PLUGINS: '["apoc"]'
22-
ports:
23-
- 7687:7687
24-
- 7474:7474
25-
options: >-
26-
--health-cmd "wget -q --method=HEAD http://localhost:7474 || exit 1"
27-
--health-start-period "60s"
28-
--health-interval "30s"
29-
--health-timeout "15s"
30-
--health-retries "5"
14+
name: "Running on PHP 8.1 with a Neo4j 4 instance connecting over all available protocols"
3115

3216
steps:
3317
- uses: actions/checkout@v2
34-
- name: Cache Composer dependencies
35-
uses: actions/cache@v2
18+
- name: Populate .env
19+
run: |
20+
echo "CONNECTION=neo4j://neo4j:testtest@neo4j" > .env
21+
- uses: hoverkraft-tech/[email protected]
3622
with:
37-
path: /tmp/composer-cache
38-
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
39-
- uses: php-actions/composer@v6
23+
compose-file: './docker-compose-neo4j-4.yml'
24+
up-flags: '--build'
25+
- name: Composer install
26+
run: |
27+
docker compose run client composer install
28+
- name: Test neo4j://
29+
run: |
30+
docker compose run -e CONNECTION=neo4j://neo4j:testtest@neo4j client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
31+
- name: Test bolt://
32+
run: |
33+
docker compose run -e CONNECTION=bolt://neo4j:testtest@neo4j client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
34+
- name: Test http://
35+
run: |
36+
docker compose run -e CONNECTION=http://neo4j:testtest@neo4j client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
37+
tests-v5:
38+
runs-on: ubuntu-latest
39+
name: "Running on PHP 8.1 with a Neo4j 5 instance connecting over all available protocols"
40+
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: Populate .env
44+
run: |
45+
echo "CONNECTION=neo4j://neo4j:testtest@neo4j" > .env
46+
- uses: hoverkraft-tech/[email protected]
4047
with:
41-
progress: yes
42-
php_version: 8.2
43-
version: 2
44-
- name: Test multiple connections
45-
run: |
46-
CONNECTION=neo4j://neo4j:testtest@localhost ./vendor/bin/phpunit --configuration=phpunit.xml.dist --testsuite=Integration & \
47-
CONNECTION=bolt://neo4j:testtest@localhost ./vendor/bin/phpunit --configuration=phpunit.xml.dist --testsuite=Integration & \
48-
CONNECTION=http://neo4j:testtest@localhost ./vendor/bin/phpunit --configuration=phpunit.xml.dist --testsuite=Integration & \
49-
wait
48+
compose-file: './docker-compose.yml'
49+
up-flags: '--build'
50+
- name: Composer install
51+
run: |
52+
docker compose run client composer install
53+
- name: Test neo4j://
54+
run: |
55+
docker compose run -e CONNECTION=neo4j://neo4j:testtest@neo4j client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
56+
- name: Test bolt://
57+
run: |
58+
docker compose run -e CONNECTION=bolt://neo4j:testtest@neo4j client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
59+
- name: Test http://
60+
run: |
61+
docker compose run -e CONNECTION=http://neo4j:testtest@neo4j client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration

docker-compose-neo4j-4.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
version: '3.8'
2-
31
x-shared:
42
&common
53
NEO4J_AUTH: neo4j/testtest
64
NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
75
NEO4J_dbms_security_allow__csv__import__from__file__urls: "true"
6+
NEO4JLABS_PLUGINS: '["apoc"]'
87

98
x-shared-cluster:
109
&common-cluster
@@ -31,16 +30,15 @@ services:
3130
build:
3231
context: .
3332
dockerfile: Dockerfile
34-
image: arestravel/php-8.0
35-
working_dir: /opt/project
3633
networks:
3734
- neo4j
3835
volumes:
3936
- .:/opt/project
40-
expose:
41-
- 9000
4237
env_file:
4338
- .env
39+
depends_on:
40+
neo4j:
41+
condition: service_healthy
4442
testkit-backend:
4543
build:
4644
context: .

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ x-definitions:
2424
build:
2525
context: .
2626
dockerfile: Dockerfile
27-
# image: neo4j-php-client:latest
2827
volumes:
2928
- .:/opt/project
3029
x-common-cluster:
@@ -48,6 +47,9 @@ services:
4847
- .:/opt/project
4948
env_file:
5049
- .env
50+
depends_on:
51+
neo4j:
52+
condition: service_healthy
5153
neo4j:
5254
<<: *common
5355
image: neo4j:5.20-community

src/Http/HttpHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final class HttpHelper
4949
*/
5050
public static function interpretResponse(ResponseInterface $response): stdClass
5151
{
52-
if ($response->getStatusCode() >= 400) {
52+
if ($response->getStatusCode() >= 500) {
5353
throw new RuntimeException('HTTP Error: '.$response->getReasonPhrase());
5454
}
5555

0 commit comments

Comments
 (0)