From 6f90edf22185a6b92153d374fdae2907abfad220 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Thu, 28 Aug 2025 15:19:45 -0700 Subject: [PATCH] cli-test(fix): wait for cli run start trace instead of activity output --- packages/cli-test/src/cli/commands/platform.spec.ts | 13 +++++++++++++ packages/cli-test/src/cli/commands/platform.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/cli-test/src/cli/commands/platform.spec.ts b/packages/cli-test/src/cli/commands/platform.spec.ts index 74bf29d72..3c289698d 100644 --- a/packages/cli-test/src/cli/commands/platform.spec.ts +++ b/packages/cli-test/src/cli/commands/platform.spec.ts @@ -3,6 +3,7 @@ import assert from 'node:assert'; import sinon from 'sinon'; import type { ShellProcess } from '../../types/shell'; +import { SlackTracerId } from '../../utils/constants'; import { mockProcess } from '../../utils/test'; import { shell } from '../shell'; import platform from './platform'; @@ -86,6 +87,12 @@ describe('platform commands', () => { sinon.match.string, sinon.match.array.contains(['run', '--cleanup', '--hide-triggers']), ); + sandbox.assert.calledWith( + waitForOutputSpy, + SlackTracerId.SLACK_TRACE_PLATFORM_RUN_START, + sinon.match.object, + sinon.match.object, + ); }); it('should invoke `run` without --hide-triggers if hideTriggers=false', async () => { await platform.runStart({ appPath: '/some/path', hideTriggers: false }); @@ -119,6 +126,12 @@ describe('platform commands', () => { sandbox.stub(shell, 'kill').resolves(); await platform.runStop({ proc: fakeProcess, waitForShutdown: true }); assert.ok(true); + sandbox.assert.calledWith( + waitForOutputSpy, + SlackTracerId.SLACK_TRACE_PLATFORM_RUN_STOP, + sinon.match.object, + sinon.match.object, + ); }); }); }); diff --git a/packages/cli-test/src/cli/commands/platform.ts b/packages/cli-test/src/cli/commands/platform.ts index d7a849866..7f90fdc4b 100644 --- a/packages/cli-test/src/cli/commands/platform.ts +++ b/packages/cli-test/src/cli/commands/platform.ts @@ -120,7 +120,7 @@ export const runStart = async function runStart( '--hide-triggers': typeof args.hideTriggers !== 'undefined' ? args.hideTriggers : true, '--org-workspace-grant': args.orgWorkspaceGrantFlag, }); - const proc = await cmd.execAsyncUntilOutputPresent('Connected, awaiting events', { + const proc = await cmd.execAsyncUntilOutputPresent(SlackTracerId.SLACK_TRACE_PLATFORM_RUN_START, { cwd: args.appPath, timeout: args.timeout, });