diff --git a/sdk/tests/backlog-picker-flow.test.ts b/sdk/tests/backlog-picker-flow.test.ts index af7ead69..0b938437 100644 --- a/sdk/tests/backlog-picker-flow.test.ts +++ b/sdk/tests/backlog-picker-flow.test.ts @@ -29,6 +29,13 @@ function run(command: string, cwd: string): string { return execFileSync('sh', ['-c', command], { cwd, encoding: 'utf8', + stdio: ['ignore', 'pipe', 'pipe'], + // Capture stderr instead of letting it through to ours. Several tests here + // assert that a step FAILS, and `execFileSync` otherwise echoes the child's + // stack trace into the suite's output -- so a passing run prints + // `ENOENT ... .relayflow/backlog-picker-entry.json` and looks broken. + // #156 was filed on exactly that appearance. The text is still available on + // the thrown error for a test that wants to assert on it. env: { ...process.env, RELAYFLOWS_SDK_DIST: join(__dirname, '..', 'dist') }, }); } diff --git a/sdk/tests/work-package-consumer.test.ts b/sdk/tests/work-package-consumer.test.ts index 46781a0b..aae51acf 100644 --- a/sdk/tests/work-package-consumer.test.ts +++ b/sdk/tests/work-package-consumer.test.ts @@ -77,7 +77,8 @@ describe('the Garden join: picker output feeds the consumer', () => { const flowPath = join(__dirname, '..', '..', 'testdata', 'backlog-picker.flow.yaml'); const flow = load(readFileSync(flowPath, 'utf8')) as { steps: Array<{ id: string; command: string }> }; const step = (id: string) => flow.steps.find((s) => s.id === id)!.command; - const run = (cmd: string, cwd: string) => execFileSync('sh', ['-c', cmd], { cwd, encoding: 'utf8', env: { ...process.env, RELAYFLOWS_SDK_DIST: join(__dirname, '..', 'dist') }, }); + // stdio: stderr captured, not echoed -- see backlog-picker-flow.test.ts. + const run = (cmd: string, cwd: string) => execFileSync('sh', ['-c', cmd], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], env: { ...process.env, RELAYFLOWS_SDK_DIST: join(__dirname, '..', 'dist') }, }); const dir = mkdtempSync(join(tmpdir(), 'garden-join-')); try {