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

Commit

Permalink
cypress: log stdout/stderr when docker exec fails (#9154)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kegsay authored Aug 9, 2022
1 parent 5a9c2e5 commit 147ec49
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cypress/plugins/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ export function dockerExec(args: {
childProcess.execFile("docker", [
"exec", args.containerId,
...args.params,
], { encoding: 'utf8' }, err => {
if (err) reject(err);
else resolve();
], { encoding: 'utf8' }, (err, stdout, stderr) => {
if (err) {
console.log(stdout);
console.log(stderr);
reject(err);
return;
}
resolve();
});
});
}
Expand Down

0 comments on commit 147ec49

Please sign in to comment.