Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve integration tests #81

Merged
merged 9 commits into from
Aug 21, 2024
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
21 changes: 20 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
APP_ENV: ci

strategy:
max-parallel: 10
matrix:
php: [ '8.1', '8.2', '8.3']
php: [ '8.1', '8.2', '8.3' ]
sf_version: [ '5.4', '6.4', '7.1' ]
exclude:
- php: 8.1
Expand All @@ -40,3 +43,19 @@ jobs:
memory_limit: 1024M
version: 9
bootstrap: vendor/autoload.php

services:
neo4j:
image: neo4j:5.22
env:
NEO4J_AUTH: neo4j/testtest
options: >-
--hostname neo4j
--health-cmd "wget -q --method=HEAD http://localhost:7474 || exit 1"
--health-start-period "60s"
--health-interval "30s"
--health-timeout "15s"
--health-retries "5"
ports:
- 7474:7474
- 7687:7687
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version: '3.7'
networks:
neo4j-symfony:

services:
app:
user: ${UID-1000}:${GID-1000}
user: root:${UID-1000}:${GID-1000}
build:
context: .
ports:
Expand All @@ -24,7 +23,7 @@ services:
neo4j:
environment:
- NEO4J_AUTH=neo4j/testtest
image: neo4j:5
image: neo4j:5.22
ports:
- ${DOCKER_HOST_NEO4J_HTTP_PORT:-7474}:7474
- ${DOCKER_HOST_NEO4J_BOLT_PORT:-7687}:7687
Expand Down
3 changes: 3 additions & 0 deletions tests/App/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ public function registerBundles(): array
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/default.yml');
if ('ci' === $this->environment) {
$loader->load(__DIR__.'/config/ci/default.yml');
}
}
}
4 changes: 4 additions & 0 deletions tests/App/config/ci/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
neo4j.dsn.badname: bolt://localhostt
neo4j.dsn.test: neo4j://neo4j:testtest@localhost
neo4j.dsn.auth: neo4j://localhost
98 changes: 55 additions & 43 deletions tests/App/config/default.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,58 @@
framework:
secret: test
test: true

neo4j:
default_driver: neo4j-test
default_driver_config:
acquire_connection_timeout: 10
user_agent: 'Neo4j Symfony Bundle/testing'
pool_size: 256
ssl:
mode: enable
verify_peer: false
default_session_config:
fetch_size: 999
access_mode: read
database: symfony
default_transaction_config:
timeout: 40

drivers:
- alias: neo4j_undefined_configs
dsn: bolt://localhost

- alias: neo4j-enforced-defaults
dsn: bolt://localhost
priority: null

- alias: neo4j-partly-enforced-defaults
dsn: neo4j://neo4j:secret@localhost:7688

- alias: neo4j-simple
dsn: 'bolt://test:test@localhost'

- alias: neo4j-fallback-mechanism
priority: 100
dsn: bolt://localhost

- alias: neo4j-fallback-mechanism
priority: 1000
dsn: bolt://localhost

- alias: neo4j-test
dsn: neo4j://neo4j:testtest@neo4j
secret: test
test: true

parameters:
neo4j.dsn.badname: bolt://localhost
neo4j.dsn.secret: neo4j://neo4j:secret@localhost:7688
neo4j.dsn.test: neo4j://neo4j:testtest@neo4j
neo4j.dsn.auth: neo4j://neo4j
neo4j.dsn.simple: bolt://test:test@localhost

neo4j:
default_driver: neo4j-test
default_driver_config:
acquire_connection_timeout: 10
user_agent: "Neo4j Symfony Bundle/testing"
pool_size: 256
ssl:
mode: disable
verify_peer: false
default_session_config:
fetch_size: 999
access_mode: read
database: neo4j
default_transaction_config:
timeout: 40

drivers:
- alias: neo4j_undefined_configs
dsn: "%neo4j.dsn.badname%"

- alias: neo4j-enforced-defaults
dsn: "%neo4j.dsn.badname%"
priority: null

- alias: neo4j-partly-enforced-defaults
dsn: "%neo4j.dsn.secret%"

- alias: neo4j-simple
dsn: "%neo4j.dsn.simple%"

- alias: neo4j-fallback-mechanism
priority: 100
dsn: "%neo4j.dsn.badname%"

- alias: neo4j-fallback-mechanism
priority: 1000
dsn: "%neo4j.dsn.badname%"

- alias: neo4j-test
dsn: "%neo4j.dsn.test%"

- alias: neo4j-auth
dsn: "%neo4j.dsn.auth%"
authentication:
type: basic
username: neo4j
password: testtest
76 changes: 0 additions & 76 deletions tests/Functional/Integration.php

This file was deleted.

Loading
Loading