runExec currently merges stdout and stderr into the same PassThrough stream:
|
exec.modem.demuxStream(stream, dataStream, dataStream) |
Ideally we separate them.
This would allow us to capture error output - e.g. from occ - separately when we care about it.
Then we could make some scenarios like the docker-modem workaround in runOcc more robust:
|
// Build app list |
|
const json = await runOcc(['app:list', '--output', 'json'], { container }) |
|
// fix dockerode bug returning invalid leading characters |
|
const applist = JSON.parse(json.substring(json.indexOf('{'))) |
e.g.:
const { stdout, stderr } = await runOcc(['app:list', '--output', 'json'], { container })
if (stderr.trim()) {
console.warn(`├─ occ stderr: ${stderr.trim()}`)
}
// Strip any residual binary header bytes from stdout only (docker-modem demuxing bug)
const cleaned = stdout.replace(/^[\x00-\x08\x0e-\x1f]+/, '')
const applist = JSON.parse(cleaned)
runExeccurrently mergesstdoutandstderrinto the samePassThroughstream:nextcloud-e2e-test-server/lib/docker.ts
Line 411 in 7802184
Ideally we separate them.
This would allow us to capture error output - e.g. from
occ- separately when we care about it.Then we could make some scenarios like the docker-modem workaround in
runOccmore robust:nextcloud-e2e-test-server/lib/docker.ts
Lines 259 to 262 in 7802184
e.g.: