Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 147ec49

Browse files
authored
cypress: log stdout/stderr when docker exec fails (#9154)
Otherwise you cannot debug anything with errors like: ``` > Command failed: docker exec 134c9a0afd7dadd0b82ce69b4d72d3d6d8ca1b211540d4390a88357b68fa03b9 pg_isready -U postgres ``` Now we include the stdout/err prior to logging this.
1 parent 5a9c2e5 commit 147ec49

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cypress/plugins/docker/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,14 @@ export function dockerExec(args: {
6161
childProcess.execFile("docker", [
6262
"exec", args.containerId,
6363
...args.params,
64-
], { encoding: 'utf8' }, err => {
65-
if (err) reject(err);
66-
else resolve();
64+
], { encoding: 'utf8' }, (err, stdout, stderr) => {
65+
if (err) {
66+
console.log(stdout);
67+
console.log(stderr);
68+
reject(err);
69+
return;
70+
}
71+
resolve();
6772
});
6873
});
6974
}

0 commit comments

Comments
 (0)