Skip to content

Commit

Permalink
split tests in integration and unit
Browse files Browse the repository at this point in the history
  • Loading branch information
transistive committed Dec 1, 2021
1 parent 485254b commit 7998555
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 70 deletions.
53 changes: 28 additions & 25 deletions .github/workflows/full-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/test
NEO4J_dbms_mode: CORE
NEO4J_causalClustering_discoveryAdvertisedAddress: core1:5000
NEO4J_causalClustering_transactionAdvertisedAddress: core1:6000
NEO4J_causalClustering_raftAdvertisedAddress: core1:7000
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_disable__middleware__logging: false
NEO4J_causal__clustering_discovery__advertised__address: core1:5000
NEO4J_causal__clustering_transaction__advertised__address: core1:6000
NEO4J_causal__clustering_raft__advertised__address: core1:7000
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
NEO4J_dbms_connector_bolt_advertised__address: localhost:17687
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
NEO4J_dbms_connector_http_advertised__address: localhost:17474
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
options: >-
--health-cmd "wget http://localhost:7474 || exit 1"
ports:
Expand All @@ -71,14 +71,15 @@ jobs:
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/test
NEO4J_dbms_mode: CORE
NEO4J_causalClustering_discoveryAdvertisedAddress: core2:5000
NEO4J_causalClustering_transactionAdvertisedAddress: core2:6000
NEO4J_causalClustering_raftAdvertisedAddress: core2:7000
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_discovery__advertised__address: core2:5000
NEO4J_causal__clustering_transaction__advertised__address: core2:6000
NEO4J_causal__clustering_raft__advertised__address: core2:7000
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
NEO4J_dbms_connector_bolt_advertised__address: localhost:27687
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
NEO4J_dbms_connector_http_advertised__address: localhost:27474
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
ports:
- 27687:7687
- 27474:7474
Expand All @@ -90,14 +91,15 @@ jobs:
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/test
NEO4J_dbms_mode: CORE
NEO4J_causalClustering_discoveryAdvertisedAddress: core3:5000
NEO4J_causalClustering_transactionAdvertisedAddress: core3:6000
NEO4J_causalClustering_raftAdvertisedAddress: core3:7000
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_discovery__advertised__address: core3:5000
NEO4J_causal__clustering_transaction__advertised__address: core3:6000
NEO4J_causal__clustering_raft__advertised__address: core3:7000
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
NEO4J_dbms_connector_bolt_advertised__address: localhost:37687
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
NEO4J_dbms_connector_http_advertised__address: localhost:37474
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
options: >-
--health-cmd "wget http://localhost:7474 || exit 1"
ports:
Expand All @@ -111,14 +113,15 @@ jobs:
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/test
NEO4J_dbms_mode: READ_REPLICA
NEO4J_causalClustering_discoveryAdvertisedAddress: readreplica1:5000
NEO4J_causalClustering_transactionAdvertisedAddress: readreplica1:6000
NEO4J_causalClustering_raftAdvertisedAddress: readreplica1:7000
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_discovery__advertised__address: readreplica1:5000
NEO4J_causal__clustering_transaction__advertised__address: readreplica1:6000
NEO4J_causal__clustering_raft__advertised__address: readreplica1:7000
NEO4J_causal__clustering_initial__discovery__members: core1:5000,core2:5000,core3:5000
NEO4J_causal__clustering_discovery__listen__address: 0.0.0.0:5000
NEO4J_causal__clustering_transaction__listen__address: 0.0.0.0:6000
NEO4J_causal__clustering_raft__listen__address: 0.0.0.0:7000
NEO4J_dbms_connector_bolt_advertised__address: localhost:47687
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7687
NEO4J_dbms_connector_http_advertised__address: localhost:47474
NEO4J_dbms_connector_http_listen__address: 0.0.0.0:7474
options: >-
--health-cmd "wget http://localhost:7474 || exit 1"
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ jobs:
runs-on: ubuntu-latest
env:
NEO4J_CONNECTIONS: bolt://neo4j:test@localhost,http://neo4j:test@localhost
name: "Running Integration tests for PHP ${{ matrix.php-version }} on Neo4j ${{ matrix.neo4j-version }} with simple config"
name: "Running Integration tests for PHP 7.4 on Neo4j ${{ matrix.neo4j-version }} with simple config"
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1']
neo4j-version: ["3.5", "4.0", "4.1", "4.2", "4.3"]

services:
Expand All @@ -35,13 +34,12 @@ jobs:
- uses: php-actions/composer@v6
with:
progress: yes
php_version: ${{ matrix.php-version }}
php_version: 7.4
version: 2
- uses: php-actions/phpunit@v3
with:
configuration: phpunit.xml.dist
php_version: ${{ matrix.php-version }}
php_version: 7.4
php_extensions: bcmath
memory_limit: 1024M
bootstrap: vendor/autoload.php
args: --testsuite "Integration"
31 changes: 31 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Unit Tests

on:
push:
branches: [ '**' ]
pull_request:
branches: ['**']

jobs:
tests:
runs-on: ubuntu-latest
name: "Running Unit tests for PHP ${{ matrix.php-version }}"
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1']

steps:
- uses: actions/checkout@v2
- uses: php-actions/composer@v6
with:
progress: yes
php_version: ${{ matrix.php-version }}
version: 2
- uses: php-actions/phpunit@v3
with:
configuration: phpunit.xml.dist
php_version: ${{ matrix.php-version }}
php_extensions: bcmath
bootstrap: vendor/autoload.php
args: --testsuite "Unit"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/275c2269aa54c2c43210/maintainability)](https://codeclimate.com/github/laudis-technologies/neo4j-php-client/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/275c2269aa54c2c43210/test_coverage)](https://codeclimate.com/github/laudis-technologies/neo4j-php-client/test_coverage)
[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/laudis-technologies/neo4j-php-client/blob/main/LICENSE)
![example workflow](https://github.com/neo4j-php/neo4j-php-client/actions/workflows/tests.yml/badge.svg)
![example workflow](https://github.com/neo4j-php/neo4j-php-client/actions/workflows/full-test.yml/badge.svg)

## Control to worlds' most powerful graph database
- Pick and choose your drivers with easy configuration
Expand Down
43 changes: 5 additions & 38 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ x-shared:
&common
NEO4J_AUTH: neo4j/test
NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_dbms_security_allow__csv__import__from__file__urls: "true"

x-shared-cluster:
Expand Down Expand Up @@ -36,12 +37,6 @@ services:
- neo4j
volumes:
- .:/opt/project
depends_on:
- neo4j
- core1
- core2
- core3
- readreplica1
expose:
- 9000
env_file:
Expand All @@ -55,12 +50,9 @@ services:
interval: 30s
timeout: 10s
retries: 5
expose:
- 7474
- 7687
ports:
- "7474:7474"
- "7687:7687"
- "7687:7687"
- "7474:7474"
environment:
<<: *common
volumes:
Expand All @@ -74,15 +66,6 @@ services:
retries: 5
networks:
- neo4j
expose:
- 7474
- 7686
- 5000
- 6000
- 7000
ports:
- "7475:7474"
- "7688:7687"
volumes:
- ./tests/resources:/import
environment:
Expand All @@ -102,12 +85,6 @@ services:
retries: 5
networks:
- neo4j
expose:
- 7474
- 7686
- 5000
- 6000
- 7000
environment:
<<: *common-core
NEO4J_causal__clustering_discovery__advertised__address: core2:5000
Expand All @@ -127,12 +104,6 @@ services:
retries: 5
networks:
- neo4j
expose:
- 7474
- 7686
- 5000
- 6000
- 7000
environment:
<<: *common-core
NEO4J_causal__clustering_discovery__advertised__address: core3:5000
Expand All @@ -152,17 +123,13 @@ services:
retries: 5
networks:
- neo4j
expose:
- 7474
- 7686
- 5000
- 6000
- 7000
environment:
<<: *common-cluster
NEO4J_dbms_mode: READ_REPLICA
NEO4J_causal__clustering_discovery__advertised__address: readreplica1:5000
NEO4J_causal__clustering_transaction__advertised__address: readreplica1:6000
NEO4J_causal__clustering_raft__advertised__address: readreplica1:7000
NEO4J_dbms_connector_http_advertised__address: readreplica1:7474
NEO4J_dbms_connector_bolt_advertised__address: readreplica1:7687
volumes:
- ./tests/resources:/import
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* file that was distributed with this source code.
*/

namespace Laudis\Neo4j\Tests\Unit;
namespace Laudis\Neo4j\Tests\Integration;

use function explode;
use function getenv;
Expand Down

0 comments on commit 7998555

Please sign in to comment.