Skip to content

Commit

Permalink
Fix docker pull in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dankochetov committed Apr 7, 2023
1 parent 5a1f4b0 commit ecce0a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion integration-tests/tests/mysql-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ async function createDockerDB(ctx: Context): Promise<string> {
const port = await getPort({ port: 3306 });
const image = 'mysql:8';

await docker.pull(image);
const pullStream = await docker.pull(image);
await new Promise((resolve, reject) =>
docker.modem.followProgress(pullStream, (err) => (err ? reject(err) : resolve(err)))
);

ctx.mysqlContainer = await docker.createContainer({
Image: image,
Expand Down
5 changes: 4 additions & 1 deletion integration-tests/tests/pg-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ async function createDockerDB(ctx: Context): Promise<string> {
const port = await getPort({ port: 5432 });
const image = 'postgres:14';

await docker.pull(image);
const pullStream = await docker.pull(image);
await new Promise((resolve, reject) =>
docker.modem.followProgress(pullStream, (err) => (err ? reject(err) : resolve(err)))
);

ctx.pgContainer = await docker.createContainer({
Image: image,
Expand Down

0 comments on commit ecce0a2

Please sign in to comment.