Skip to content

Commit

Permalink
feat: Move Neo4j v4 tests to docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
exaby73 committed Oct 9, 2024
1 parent 060b153 commit 05a0c79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 129 deletions.
132 changes: 10 additions & 122 deletions .github/workflows/integration-test-cluster-neo4j-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,126 +17,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Cache Composer dependencies
uses: actions/cache@v2
- name: Populate .env
run: |
echo "CONNECTION=neo4j://neo4j:testtest@neo4j" > .env
- uses: hoverkraft-tech/[email protected]
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-8.0-${{ hashFiles('**/composer.lock') }}
- uses: php-actions/composer@v6
with:
progress: yes
php_version: 8.1
version: 2
- uses: php-actions/phpunit@v3
with:
configuration: phpunit.xml.dist
php_version: 8.1
memory_limit: 1024M
version: 10
testsuite: Integration
bootstrap: vendor/autoload.php

services:
core1:
image: neo4j:4.4-enterprise
options: >-
--health-cmd "wget -q --method=HEAD http://localhost:7475 || exit 1"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
--health-retries "5"
ports:
- 7688:7688
- 7475:7475
env:
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/testtest
NEO4J_dbms_mode: CORE
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_http_listen__address: 0.0.0.0:7475
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7688

core2:
image: neo4j:4.4-enterprise
options: >-
--health-cmd "wget -q --method=HEAD http://localhost:7476 || exit 1"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
--health-retries "5"
ports:
- 7689:7689
- 7476:7476
env:
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/testtest
NEO4J_dbms_mode: CORE
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_http_listen__address: 0.0.0.0:7476
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7689

core3:
image: neo4j:4.4-enterprise
options: >-
--health-cmd "wget -q --method=HEAD http://localhost:7477 || exit 1"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
--health-retries "5"
ports:
- 7690:7690
- 7477:7477
env:
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/testtest
NEO4J_dbms_mode: CORE
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_http_listen__address: 0.0.0.0:7477
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7690

readreplica1:
image: neo4j:4.4-enterprise
options: >-
--health-cmd "wget -q --method=HEAD http://localhost:7478 || exit 1"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
--health-retries "5"
ports:
- 7691:7691
- 7478:7478
env:
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
NEO4JLABS_PLUGINS: '["apoc"]'
NEO4J_AUTH: neo4j/testtest
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_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_http_listen__address: 0.0.0.0:7478
NEO4J_dbms_connector_bolt_listen__address: 0.0.0.0:7691
compose-file: './docker-compose-neo4j-4.yml'
up-flags: '--build'
- name: Test
run: |
docker compose run client composer install
docker compose run client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
8 changes: 1 addition & 7 deletions docker-compose-neo4j-4.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3.8'

x-shared:
&common
NEO4J_AUTH: neo4j/test
NEO4J_AUTH: neo4j/testtest
NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
NEO4J_dbms_security_allow__csv__import__from__file__urls: "true"

Expand Down Expand Up @@ -31,14 +29,10 @@ services:
build:
context: .
dockerfile: Dockerfile
image: arestravel/php-8.0
working_dir: /opt/project
networks:
- neo4j
volumes:
- .:/opt/project
expose:
- 9000
env_file:
- .env
testkit-backend:
Expand Down

0 comments on commit 05a0c79

Please sign in to comment.