Skip to content

Commit 7998555

Browse files
committed
split tests in integration and unit
1 parent 485254b commit 7998555

File tree

6 files changed

+69
-70
lines changed

6 files changed

+69
-70
lines changed

.github/workflows/full-test.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ jobs:
5050
NEO4JLABS_PLUGINS: '["apoc"]'
5151
NEO4J_AUTH: neo4j/test
5252
NEO4J_dbms_mode: CORE
53-
NEO4J_causalClustering_discoveryAdvertisedAddress: core1:5000
54-
NEO4J_causalClustering_transactionAdvertisedAddress: core1:6000
55-
NEO4J_causalClustering_raftAdvertisedAddress: core1:7000
56-
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
57-
NEO4J_causal__clustering_disable__middleware__logging: false
53+
NEO4J_causal__clustering_discovery__advertised__address: core1:5000
54+
NEO4J_causal__clustering_transaction__advertised__address: core1:6000
55+
NEO4J_causal__clustering_raft__advertised__address: core1:7000
56+
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
57+
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
58+
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
59+
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
5860
NEO4J_dbms_connector_bolt_advertised__address: localhost:17687
59-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
6061
NEO4J_dbms_connector_http_advertised__address: localhost:17474
61-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
6262
options: >-
6363
--health-cmd "wget http://localhost:7474 || exit 1"
6464
ports:
@@ -71,14 +71,15 @@ jobs:
7171
NEO4JLABS_PLUGINS: '["apoc"]'
7272
NEO4J_AUTH: neo4j/test
7373
NEO4J_dbms_mode: CORE
74-
NEO4J_causalClustering_discoveryAdvertisedAddress: core2:5000
75-
NEO4J_causalClustering_transactionAdvertisedAddress: core2:6000
76-
NEO4J_causalClustering_raftAdvertisedAddress: core2:7000
77-
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
74+
NEO4J_causal__clustering_discovery__advertised__address: core2:5000
75+
NEO4J_causal__clustering_transaction__advertised__address: core2:6000
76+
NEO4J_causal__clustering_raft__advertised__address: core2:7000
77+
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
78+
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
79+
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
80+
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
7881
NEO4J_dbms_connector_bolt_advertised__address: localhost:27687
79-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
8082
NEO4J_dbms_connector_http_advertised__address: localhost:27474
81-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
8283
ports:
8384
- 27687:7687
8485
- 27474:7474
@@ -90,14 +91,15 @@ jobs:
9091
NEO4JLABS_PLUGINS: '["apoc"]'
9192
NEO4J_AUTH: neo4j/test
9293
NEO4J_dbms_mode: CORE
93-
NEO4J_causalClustering_discoveryAdvertisedAddress: core3:5000
94-
NEO4J_causalClustering_transactionAdvertisedAddress: core3:6000
95-
NEO4J_causalClustering_raftAdvertisedAddress: core3:7000
96-
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
94+
NEO4J_causal__clustering_discovery__advertised__address: core3:5000
95+
NEO4J_causal__clustering_transaction__advertised__address: core3:6000
96+
NEO4J_causal__clustering_raft__advertised__address: core3:7000
97+
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
98+
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
99+
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
100+
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
97101
NEO4J_dbms_connector_bolt_advertised__address: localhost:37687
98-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
99102
NEO4J_dbms_connector_http_advertised__address: localhost:37474
100-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
101103
options: >-
102104
--health-cmd "wget http://localhost:7474 || exit 1"
103105
ports:
@@ -111,14 +113,15 @@ jobs:
111113
NEO4JLABS_PLUGINS: '["apoc"]'
112114
NEO4J_AUTH: neo4j/test
113115
NEO4J_dbms_mode: READ_REPLICA
114-
NEO4J_causalClustering_discoveryAdvertisedAddress: readreplica1:5000
115-
NEO4J_causalClustering_transactionAdvertisedAddress: readreplica1:6000
116-
NEO4J_causalClustering_raftAdvertisedAddress: readreplica1:7000
117-
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
116+
NEO4J_causal__clustering_discovery__advertised__address: readreplica1:5000
117+
NEO4J_causal__clustering_transaction__advertised__address: readreplica1:6000
118+
NEO4J_causal__clustering_raft__advertised__address: readreplica1:7000
119+
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
120+
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
121+
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
122+
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
118123
NEO4J_dbms_connector_bolt_advertised__address: localhost:47687
119-
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
120124
NEO4J_dbms_connector_http_advertised__address: localhost:47474
121-
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
122125
options: >-
123126
--health-cmd "wget http://localhost:7474 || exit 1"
124127
ports:

.github/workflows/matrix-test.yml renamed to .github/workflows/integration-test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
env:
1313
NEO4J_CONNECTIONS: bolt://neo4j:test@localhost,http://neo4j:test@localhost
14-
name: "Running Integration tests for PHP ${{ matrix.php-version }} on Neo4j ${{ matrix.neo4j-version }} with simple config"
14+
name: "Running Integration tests for PHP 7.4 on Neo4j ${{ matrix.neo4j-version }} with simple config"
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php-version: ['7.4', '8.0', '8.1']
1918
neo4j-version: ["3.5", "4.0", "4.1", "4.2", "4.3"]
2019

2120
services:
@@ -35,13 +34,12 @@ jobs:
3534
- uses: php-actions/composer@v6
3635
with:
3736
progress: yes
38-
php_version: ${{ matrix.php-version }}
37+
php_version: 7.4
3938
version: 2
4039
- uses: php-actions/phpunit@v3
4140
with:
4241
configuration: phpunit.xml.dist
43-
php_version: ${{ matrix.php-version }}
42+
php_version: 7.4
4443
php_extensions: bcmath
45-
memory_limit: 1024M
4644
bootstrap: vendor/autoload.php
4745
args: --testsuite "Integration"

.github/workflows/unit-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
name: "Running Unit tests for PHP ${{ matrix.php-version }}"
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-version: ['7.4', '8.0', '8.1']
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: php-actions/composer@v6
21+
with:
22+
progress: yes
23+
php_version: ${{ matrix.php-version }}
24+
version: 2
25+
- uses: php-actions/phpunit@v3
26+
with:
27+
configuration: phpunit.xml.dist
28+
php_version: ${{ matrix.php-version }}
29+
php_extensions: bcmath
30+
bootstrap: vendor/autoload.php
31+
args: --testsuite "Unit"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Maintainability](https://api.codeclimate.com/v1/badges/275c2269aa54c2c43210/maintainability)](https://codeclimate.com/github/laudis-technologies/neo4j-php-client/maintainability)
77
[![Test Coverage](https://api.codeclimate.com/v1/badges/275c2269aa54c2c43210/test_coverage)](https://codeclimate.com/github/laudis-technologies/neo4j-php-client/test_coverage)
88
[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/laudis-technologies/neo4j-php-client/blob/main/LICENSE)
9-
![example workflow](https://github.com/neo4j-php/neo4j-php-client/actions/workflows/tests.yml/badge.svg)
9+
![example workflow](https://github.com/neo4j-php/neo4j-php-client/actions/workflows/full-test.yml/badge.svg)
1010

1111
## Control to worlds' most powerful graph database
1212
- Pick and choose your drivers with easy configuration

docker-compose.yml

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ x-shared:
44
&common
55
NEO4J_AUTH: neo4j/test
66
NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
7+
NEO4JLABS_PLUGINS: '["apoc"]'
78
NEO4J_dbms_security_allow__csv__import__from__file__urls: "true"
89

910
x-shared-cluster:
@@ -36,12 +37,6 @@ services:
3637
- neo4j
3738
volumes:
3839
- .:/opt/project
39-
depends_on:
40-
- neo4j
41-
- core1
42-
- core2
43-
- core3
44-
- readreplica1
4540
expose:
4641
- 9000
4742
env_file:
@@ -55,12 +50,9 @@ services:
5550
interval: 30s
5651
timeout: 10s
5752
retries: 5
58-
expose:
59-
- 7474
60-
- 7687
6153
ports:
62-
- "7474:7474"
63-
- "7687:7687"
54+
- "7687:7687"
55+
- "7474:7474"
6456
environment:
6557
<<: *common
6658
volumes:
@@ -74,15 +66,6 @@ services:
7466
retries: 5
7567
networks:
7668
- neo4j
77-
expose:
78-
- 7474
79-
- 7686
80-
- 5000
81-
- 6000
82-
- 7000
83-
ports:
84-
- "7475:7474"
85-
- "7688:7687"
8669
volumes:
8770
- ./tests/resources:/import
8871
environment:
@@ -102,12 +85,6 @@ services:
10285
retries: 5
10386
networks:
10487
- neo4j
105-
expose:
106-
- 7474
107-
- 7686
108-
- 5000
109-
- 6000
110-
- 7000
11188
environment:
11289
<<: *common-core
11390
NEO4J_causal__clustering_discovery__advertised__address: core2:5000
@@ -127,12 +104,6 @@ services:
127104
retries: 5
128105
networks:
129106
- neo4j
130-
expose:
131-
- 7474
132-
- 7686
133-
- 5000
134-
- 6000
135-
- 7000
136107
environment:
137108
<<: *common-core
138109
NEO4J_causal__clustering_discovery__advertised__address: core3:5000
@@ -152,17 +123,13 @@ services:
152123
retries: 5
153124
networks:
154125
- neo4j
155-
expose:
156-
- 7474
157-
- 7686
158-
- 5000
159-
- 6000
160-
- 7000
161126
environment:
162127
<<: *common-cluster
163128
NEO4J_dbms_mode: READ_REPLICA
164129
NEO4J_causal__clustering_discovery__advertised__address: readreplica1:5000
165130
NEO4J_causal__clustering_transaction__advertised__address: readreplica1:6000
166131
NEO4J_causal__clustering_raft__advertised__address: readreplica1:7000
132+
NEO4J_dbms_connector_http_advertised__address: readreplica1:7474
133+
NEO4J_dbms_connector_bolt_advertised__address: readreplica1:7687
167134
volumes:
168135
- ./tests/resources:/import

tests/Unit/ClientBuilderTest.php renamed to tests/Integration/ClientBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* file that was distributed with this source code.
1212
*/
1313

14-
namespace Laudis\Neo4j\Tests\Unit;
14+
namespace Laudis\Neo4j\Tests\Integration;
1515

1616
use function explode;
1717
use function getenv;

0 commit comments

Comments
 (0)