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.
pull/28217/head
kegsay 2022-08-09 15:22:32 +01:00 committed by GitHub
parent 5a9c2e530a
commit 147ec49ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -61,9 +61,14 @@ export function dockerExec(args: {
childProcess.execFile("docker", [ childProcess.execFile("docker", [
"exec", args.containerId, "exec", args.containerId,
...args.params, ...args.params,
], { encoding: 'utf8' }, err => { ], { encoding: 'utf8' }, (err, stdout, stderr) => {
if (err) reject(err); if (err) {
else resolve(); console.log(stdout);
console.log(stderr);
reject(err);
return;
}
resolve();
}); });
}); });
} }