Skip to content

Commit c9fa08b

Browse files
committed
fixes
1 parent 4309c58 commit c9fa08b

File tree

8 files changed

+2066
-2028
lines changed

8 files changed

+2066
-2028
lines changed

.github/workflows/split-testing.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,14 @@ jobs:
213213
if [[ "$dir" != *"PdoEventSourcing"* ]]; then
214214
local sqlite_db="/tmp/ecotone_${slug}_test.db"
215215
local sqlite_db_secondary="/tmp/ecotone_${slug}_test_b.db"
216+
# Use 4 slashes for absolute paths: sqlite:// + / + /path = sqlite:////path
217+
# This is needed because both enqueue/dsn and Doctrine's DsnParser
218+
# require 4 slashes for absolute paths to be parsed correctly
216219
if ! _run_tests "$dir (SQLite)" "\
217220
rm -f '${sqlite_db}' '${sqlite_db_secondary}' && \
218221
cd '${dir}' && \
219-
DATABASE_DSN='sqlite://${sqlite_db}' \
220-
SECONDARY_DATABASE_DSN='sqlite://${sqlite_db_secondary}' \
222+
DATABASE_DSN='sqlite:///${sqlite_db}' \
223+
SECONDARY_DATABASE_DSN='sqlite:///${sqlite_db_secondary}' \
221224
${run_tests_cmd}"; then
222225
overall_exit_code=1
223226
fi

.github/workflows/test-monorepo.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@ jobs:
152152
rm -f /tmp/ecotone_test.db /tmp/ecotone_test_b.db
153153
vendor/bin/phpunit --no-coverage --exclude-testsuite 'Event Sourcing tests'
154154
env:
155-
DATABASE_DSN: sqlite:///tmp/ecotone_test.db
156-
SECONDARY_DATABASE_DSN: sqlite:///tmp/ecotone_test_b.db
155+
# Use 4 slashes for absolute paths: sqlite:// + / + /path = sqlite:////path
156+
DATABASE_DSN: sqlite:////tmp/ecotone_test.db
157+
SECONDARY_DATABASE_DSN: sqlite:////tmp/ecotone_test_b.db
157158

158159
- name: Test Behat on SQLite
159160
run: |
160161
rm -f /tmp/ecotone_test.db /tmp/ecotone_test_b.db
161162
vendor/bin/behat -vvv
162163
env:
163-
DATABASE_DSN: sqlite:///tmp/ecotone_test.db
164-
SECONDARY_DATABASE_DSN: sqlite:///tmp/ecotone_test_b.db
164+
# Use 4 slashes for absolute paths: sqlite:// + / + /path = sqlite:////path
165+
DATABASE_DSN: sqlite:////tmp/ecotone_test.db
166+
SECONDARY_DATABASE_DSN: sqlite:////tmp/ecotone_test_b.db

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@
165165
"timacdonald/log-fake": "^2.0",
166166
"symfony/monolog-bundle": "^3.10",
167167
"kwn/php-rdkafka-stubs": "^2.2",
168-
"symfony/var-exporter": "^6.4|^7.0|^8.0"
168+
"symfony/var-exporter": "^6.4|^7.0|^8.0",
169+
"enqueue/dsn": "^0.10.27"
169170
},
170171
"conflict": {
171172
"symfony/doctrine-messenger": ">7.0.5 < 7.1.0",

packages/Dbal/src/EnqueueDbal/DbalConnectionFactory.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private function parseDsn(string $dsn, ?array $config = null): array
160160
$doctrineScheme = $supported[$parsedDsn->getScheme()];
161161

162162
if ($doctrineScheme === 'pdo_sqlite') {
163-
return $this->buildSqliteConfig($parsedDsn, $config);
163+
return $this->buildSqliteConfig($parsedDsn, $dsn, $config);
164164
}
165165

166166
$dsnHasProtocolOnly = $parsedDsn->getScheme().':' === $dsn;
@@ -192,12 +192,12 @@ private function parseDsn(string $dsn, ?array $config = null): array
192192
];
193193
}
194194

195-
private function buildSqliteConfig(Dsn $parsedDsn, ?array $config = null): array
195+
private function buildSqliteConfig(Dsn $parsedDsn, string $originalDsn, ?array $config = null): array
196196
{
197197
$path = $parsedDsn->getPath();
198198

199199
if ($path === null || $path === '') {
200-
$path = ':memory:';
200+
$path = $this->extractSqlitePathFromDsn($originalDsn);
201201
}
202202

203203
if ($path !== ':memory:') {
@@ -221,4 +221,20 @@ private function buildSqliteConfig(Dsn $parsedDsn, ?array $config = null): array
221221
'connection' => $connectionConfig,
222222
];
223223
}
224+
225+
private function extractSqlitePathFromDsn(string $dsn): string
226+
{
227+
if (preg_match('#^sqlite3?:///?(.*)$#', $dsn, $matches)) {
228+
$pathPart = $matches[1];
229+
if ($pathPart === '' || $pathPart === ':memory:') {
230+
return ':memory:';
231+
}
232+
if (str_starts_with($pathPart, '/')) {
233+
return $pathPart;
234+
}
235+
return '/' . $pathPart;
236+
}
237+
238+
return ':memory:';
239+
}
224240
}

packages/Symfony/config/reference.php

Lines changed: 709 additions & 699 deletions
Large diffs are not rendered by default.

packages/Symfony/tests/phpunit/DbalConnectionRequirement/config/reference.php

Lines changed: 382 additions & 380 deletions
Large diffs are not rendered by default.

packages/Symfony/tests/phpunit/DbalConnectionRequirementWithConnection/config/reference.php

Lines changed: 382 additions & 380 deletions
Large diffs are not rendered by default.

packages/Symfony/tests/phpunit/SingleTenant/config/reference.php

Lines changed: 561 additions & 559 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)