Skip to content

Commit 8573149

Browse files
committed
fix: update Docker container handling in setup function
Signed-off-by: Vladislav Polyakov <[email protected]>
1 parent 8213ce7 commit 8573149

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vitest.setup.e2e.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ export async function setup(project: TestProject) {
3131
return
3232
}
3333

34-
await $`docker run --rm --detach --publish 2135 --publish 2136 --publish 8765 --publish 9092 --hostname localhost --platform linux/amd64 --name ydb ydbplatform/local-ydb:25.1.1.3`
34+
let containerID = await $`docker run --rm --detach --publish 2135 --publish 2136 --publish 8765 --publish 9092 --hostname localhost --platform linux/amd64 ydbplatform/local-ydb:25.1.1.3`.text()
35+
containerID = containerID.trim()
3536

3637
let signal = AbortSignal.timeout(30 * 1000)
37-
while ((await $`docker inspect -f {{.State.Health.Status}} ydb`.text()).trim() !== 'healthy') {
38+
while ((await $`docker inspect -f {{.State.Health.Status}} ${containerID}`.text()).trim() !== 'healthy') {
3839
signal.throwIfAborted()
3940
await $`sleep 1`
4041
}
4142

42-
let [ipv4, _ipv6] = await $`docker port ydb 2136/tcp`.lines()
43+
let [ipv4, _ipv6] = await $`docker port ${containerID} 2136/tcp`.lines()
4344

4445
project.provide('connectionString', `grpc://${ipv4}/local`)
4546
project.provide('credentialsUsername', 'root')

0 commit comments

Comments
 (0)