Skip to content
Myr

Fix failure of series of `.pipe()` (#849)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 55800c3 · Browse files · 6 files+17 added−17 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+17 added−17 removed

  • tests:+9 added−9 removed
  • other:+8 added−8 removed

6 files+17 added−17 removed

modified:lib/pipe/sequence.js+2 added-2 removed
modified:lib/pipe/setup.js+3 added-3 removed
modified:lib/pipe/validate.js+2 added-2 removed
modified:lib/async.js+1 added-1 removed
30 unmodified lines
31 cleanupOnExit(spawned, options, controller);3233 spawned.kill = spawnedKill.bind(undefined, {kill: spawned.kill.bind(spawned), spawned, options, controller});34 spawned.all = makeAllStream(spawned, options);35 spawned.pipe = pipeToProcess.bind(undefined, {spawned, stdioStreamsGroups, options});3536 const promise = handlePromise({spawned, options, stdioStreamsGroups, originalStreams, command, escapedCommand, controller});37 spawned.pipe = pipeToProcess.bind(undefined, {source: spawned, sourcePromise: promise, stdioStreamsGroups, options});38 mergePromise(spawned, promise);39 return spawned;40};41
48 unmodified lines
modified:test/pipe/sequence.js+5 added-5 removed
92 unmodified lines
93 const source = execa('noop-fail.js', ['1', foobarString]);94 const destination = execa('stdin.js');95 const secondDestination = execa('stdin.js');96 const pipePromise = source.pipe(destination);97 const secondPipePromise = destination.pipe(secondDestination);97 const secondPipePromise = pipePromise.pipe(secondDestination);9899 t.is(await t.throwsAsync(pipePromise), await t.throwsAsync(source));100 await secondPipePromise;100 t.is(await t.throwsAsync(secondPipePromise), await t.throwsAsync(source));101 t.like(await t.throwsAsync(source), {stdout: foobarString, exitCode: 2});102 await destination;103 await secondDestination;102 t.like(await destination, {stdout: foobarString});103 t.like(await secondDestination, {stdout: foobarString});104});105106const testSourceTerminated = async (t, signal) => {107 const source = execa('noop-repeat.js');
35 unmodified lines
143 const source = execa('noop-repeat.js');144 const destination = execa('stdin.js');145 const secondDestination = execa('fail.js');146 const pipePromise = source.pipe(destination);147 const secondPipePromise = destination.pipe(secondDestination);147 const secondPipePromise = pipePromise.pipe(secondDestination);148149 t.is(await t.throwsAsync(pipePromise), await t.throwsAsync(destination));150 t.is(await t.throwsAsync(secondPipePromise), await t.throwsAsync(secondDestination));151 t.like(await t.throwsAsync(secondDestination), {exitCode: 2});
162 unmodified lines
modified:test/pipe/streaming.js+4 added-4 removed
177 unmodified lines
178 const source = execa('noop.js', [foobarString]);179 const destination = execa('stdin.js');180 const secondDestination = execa('stdin.js');181 const pipePromise = source.pipe(destination);182 const secondPipePromise = destination.pipe(secondDestination);182 const secondPipePromise = pipePromise.pipe(secondDestination);183 const thirdPipePromise = source.pipe(secondDestination);184185 t.like(await source, {stdout: foobarString});186 t.like(await destination, {stdout: foobarString});
68 unmodified lines
255 const source = execa('noop.js', [foobarString]);256 const destination = execa('stdin.js');257 const secondDestination = execa('stdin.js');258 const pipePromise = source.pipe(destination);259 const secondPipePromise = destination.pipe(secondDestination);259 const secondPipePromise = pipePromise.pipe(secondDestination);260261 t.like(await source, {stdout: foobarString});262 t.like(await destination, {stdout: foobarString});263 t.like(await secondDestination, {stdout: foobarString});
19 unmodified lines
283 const source = execa('noop.js', [foobarString]);284 const destination = execa('stdin.js');285 const secondDestination = execa('stdin.js');286 const pipePromise = source.pipe(destination);287 const secondPipePromise = destination.pipe(secondDestination);287 const secondPipePromise = pipePromise.pipe(secondDestination);288289 const destinationResult = await destination;290 t.deepEqual(destinationResult.pipedFrom, []);291 const secondDestinationResult = await secondDestination;
51 unmodified lines
343 const source = execa('noop-fail.js', ['1', foobarString]);344 const destination = execa('stdin-fail.js');345 const secondDestination = execa('stdin.js');346 const pipePromise = source.pipe(destination);347 const secondPipePromise = destination.pipe(secondDestination);347 const secondPipePromise = pipePromise.pipe(secondDestination);348349 const destinationResult = await t.throwsAsync(destination);350 const secondDestinationResult = await secondDestination;351 t.deepEqual(secondDestinationResult.pipedFrom, []);
77 unmodified lines