Skip to content

Commit 6f90edf

Browse files
committed
cli-test(fix): wait for cli run start trace instead of activity output
1 parent 06a3dcf commit 6f90edf

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

packages/cli-test/src/cli/commands/platform.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import assert from 'node:assert';
33
import sinon from 'sinon';
44

55
import type { ShellProcess } from '../../types/shell';
6+
import { SlackTracerId } from '../../utils/constants';
67
import { mockProcess } from '../../utils/test';
78
import { shell } from '../shell';
89
import platform from './platform';
@@ -86,6 +87,12 @@ describe('platform commands', () => {
8687
sinon.match.string,
8788
sinon.match.array.contains(['run', '--cleanup', '--hide-triggers']),
8889
);
90+
sandbox.assert.calledWith(
91+
waitForOutputSpy,
92+
SlackTracerId.SLACK_TRACE_PLATFORM_RUN_START,
93+
sinon.match.object,
94+
sinon.match.object,
95+
);
8996
});
9097
it('should invoke `run` without --hide-triggers if hideTriggers=false', async () => {
9198
await platform.runStart({ appPath: '/some/path', hideTriggers: false });
@@ -119,6 +126,12 @@ describe('platform commands', () => {
119126
sandbox.stub(shell, 'kill').resolves();
120127
await platform.runStop({ proc: fakeProcess, waitForShutdown: true });
121128
assert.ok(true);
129+
sandbox.assert.calledWith(
130+
waitForOutputSpy,
131+
SlackTracerId.SLACK_TRACE_PLATFORM_RUN_STOP,
132+
sinon.match.object,
133+
sinon.match.object,
134+
);
122135
});
123136
});
124137
});

packages/cli-test/src/cli/commands/platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const runStart = async function runStart(
120120
'--hide-triggers': typeof args.hideTriggers !== 'undefined' ? args.hideTriggers : true,
121121
'--org-workspace-grant': args.orgWorkspaceGrantFlag,
122122
});
123-
const proc = await cmd.execAsyncUntilOutputPresent('Connected, awaiting events', {
123+
const proc = await cmd.execAsyncUntilOutputPresent(SlackTracerId.SLACK_TRACE_PLATFORM_RUN_START, {
124124
cwd: args.appPath,
125125
timeout: args.timeout,
126126
});

0 commit comments

Comments
 (0)