Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/integration-test-cluster-neo4j-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
Expand All @@ -29,5 +27,5 @@ jobs:
up-flags: '--build --remove-orphans'
- name: Test
run: |
docker compose run client composer install
docker compose run client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
docker compose run --rm client composer install
docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
6 changes: 2 additions & 4 deletions .github/workflows/integration-test-cluster-neo4j-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
Expand All @@ -29,5 +27,5 @@ jobs:
up-flags: '--build --remove-orphans'
- name: Test
run: |
docker compose run client composer install
docker compose run client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
docker compose run --rm client composer install
docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
8 changes: 3 additions & 5 deletions .github/workflows/integration-test-single-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
tests-v4:
Expand Down Expand Up @@ -62,16 +60,16 @@ jobs:
up-flags: '--build'
- name: Composer install
run: |
docker compose run client composer install
docker compose run --rm client composer install
- name: Test neo4j://
run: |
docker compose run \
docker compose run --rm \
-e PHP_VERSION=${{ matrix.php }} \
-e CONNECTION=neo4j://neo4j:testtest@neo4j \
client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
- name: Test bolt://
run: |
docker compose run \
docker compose run --rm \
-e PHP_VERSION=${{ matrix.php }} \
-e CONNECTION=bolt://neo4j:testtest@neo4j \
client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
3 changes: 1 addition & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
php-cs-fixer:
name: "Lint & Analyse"
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/testkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Testkit

on:
push:
branches:
- main
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
name: "Testkit"

steps:
- uses: actions/checkout@v4
- name: Populate .env
run: |
echo "PHP_VERSION=8.3.17" > .env
echo "CONNECTION=neo4j://neo4j:testtest@server1" >> .env
- uses: hoverkraft-tech/[email protected]
name: Start services
with:
compose-file: './docker-compose.yml'
up-flags: '--build --remove-orphans'
- name: Test
run: |
docker compose run --rm client composer install
# We need to restart the testkit_backend service since it relies on the previous step (composer install) to work
docker compose restart testkit_backend
docker compose logs testkit_backend
docker compose run --rm testkit ./testkit.sh
4 changes: 1 addition & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
Expand All @@ -33,7 +31,7 @@ jobs:

- name: Install dependencies
run: composer install

- uses: php-actions/phpunit@v4
with:
configuration: phpunit.xml.dist
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ services:
NEO4J_server_bolt_advertised__address: server4:7687
NEO4J_server_http_advertised__address: server4:7474

testkit:
image: python:3.13
volumes:
- .:/opt/project
working_dir: /opt/project/testkit-backend
networks:
- neo4j
environment:
TEST_NEO4J_HOST: neo4j
TEST_NEO4J_USER: neo4j
TEST_NEO4J_PASS: testtest
TEST_DRIVER_NAME: php
TEST_DRIVER_REPO: /opt/project
TEST_BACKEND_HOST: testkit_backend

testkit_backend:
<<: *common-php
environment:
Expand Down
2 changes: 1 addition & 1 deletion src/Databags/ServerInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function toArray(): array
{
return [
'address' => $this->address,
'protocol' => $this->protocol,
'protocolVersion' => $this->protocol,
'agent' => $this->agent,
];
}
Expand Down
36 changes: 21 additions & 15 deletions testkit-backend/testkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

TESTKIT_VERSION=5.0

export TEST_NEO4J_HOST=neo4j
export TEST_NEO4J_USER=neo4j
export TEST_NEO4J_PASS=testtest
export TEST_DRIVER_NAME=php
[ -z "$TEST_NEO4J_HOST" ] && export TEST_NEO4J_HOST=neo4j
[ -z "$TEST_NEO4J_USER" ] && export TEST_NEO4J_USER=neo4j
[ -z "$TEST_NEO4J_PASS" ] && export TEST_NEO4J_PASS=testtest
[ -z "$TEST_DRIVER_NAME" ] && export TEST_DRIVER_NAME=php


TEST_DRIVER_REPO=$(realpath ..)
export TEST_DRIVER_REPO
[ -z "$TEST_DRIVER_REPO" ] && TEST_DRIVER_REPO=$(realpath ..) && export TEST_DRIVER_REPO

if [ "$1" == "--clean" ]; then
if [ -d testkit ]; then
Expand All @@ -18,7 +16,7 @@ if [ "$1" == "--clean" ]; then
fi

if [ ! -d testkit ]; then
git clone git@github.com:neo4j-drivers/testkit.git
git clone https://github.com/neo4j-drivers/testkit.git
if [ "$(cd testkit && git branch --show-current)" != "${TESTKIT_VERSION}" ]; then
(cd testkit && git checkout ${TESTKIT_VERSION})
fi
Expand All @@ -31,12 +29,20 @@ python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# python3 main.py --tests UNIT_TESTS

echo "Starting tests..."
# exec python3 main.py --tests UNIT_TESTS
(exec python3 -m unittest tests.neo4j.test_authentication.TestAuthenticationBasic) || true
#echo "TestAuthenticationBasic Done"
python3 -m unittest tests.neo4j.test_bookmarks.TestBookmarks || true
echo "TestBookmarks Done"
#python3 -m unittest tests.neo4j.test_session_run.TestSessionRun.test_recover_from_fail_on_streaming|| true
#echo "TestSessionRun Done"

EXIT_CODE=0

python3 -m unittest tests.neo4j.test_authentication.TestAuthenticationBasic || EXIT_CODE=1

python3 -m unittest tests.neo4j.test_bookmarks.TestBookmarks || EXIT_CODE=1

python3 -m unittest tests.neo4j.test_session_run.TestSessionRun.test_iteration_nested || EXIT_CODE=1

# Uncomment to run this test as well
# python3 -m unittest tests.neo4j.test_session_run.TestSessionRun.test_recover_from_fail_on_streaming || EXIT_CODE=1

exit $EXIT_CODE

Loading