Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/cli-test/src/cli/commands/platform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗣️ note: This is preferred over SLACK_TRACE_PLATFORM_RUN_READY since the "ready" variable appears once activity logs stream for CLI managed connections. It does not appear for bolt apps at this time.

👁️‍🗨️ thought: I'm unsure if we should add that trace to the CLI outputs in a follow up PR? For now I think using a trace is still an improvement but I'm somewhat worried about tests skipping to the next step before run is settled for some apps... 🦕

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure if we should add that trace to the CLI outputs in a follow up PR?

Just checking if I understand correctly - are you thinking that the CLI would print the SLACK_TRACE_PLATFORM_RUN_READY trace for sdk-managed socket connections?

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 });
Expand Down Expand Up @@ -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,
);
});
});
});
2 changes: 1 addition & 1 deletion packages/cli-test/src/cli/commands/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
Loading