Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/core/src/awsService/sagemaker/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ async function handleRunningSpaceWithDisabledAccess(

const confirmed = await showConfirmationMessage({
prompt,
confirm: 'Restart and Connect',
confirm: 'Restart Space and Connect',
cancel: 'Cancel',
type: 'warning',
})
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/awsService/sagemaker/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const InstanceTypeInsufficientMemoryMessage = (
chosenInstanceType: string,
recommendedInstanceType: string
) => {
return `Unable to create app for [${spaceName}] because instanceType [${chosenInstanceType}] is not supported for remote access enabled spaces. Use instanceType with at least 8 GiB memory. Would you like to start your space with instanceType [${recommendedInstanceType}]?`
return `[${chosenInstanceType}] does not support remote access. Use an instanceType with at least 8 GiB memory. Would you like to start your space with instanceType [${recommendedInstanceType}]?`
}

export const InstanceTypeNotSelectedMessage = (spaceName: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class SageMakerUnifiedStudioProjectNode implements TreeNode {
if (this.isFirstTimeSelection && !this.hasShownFirstTimeMessage) {
this.hasShownFirstTimeMessage = true
void vscode.window.showInformationMessage(
'Find your space in the Explorer panel under SageMaker Unified Studio. Hover over any space and click the connection icon to connect remotely.'
'Find your space in the Explorer panel under SageMaker Unified Studio. Hover over a space and click the connection icon to connect remotely.'
)
}
this.sagemakerClient = await this.initializeSagemakerClient(spaceAwsAccountRegion)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/shared/clients/sagemaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class SagemakerClient extends ClientWrapper<SageMakerClient> {
instanceType,
InstanceTypeInsufficientMemory[instanceType]
),
confirm: 'Restart and Connect',
confirm: 'Restart Space and Connect',
cancel: 'Cancel',
type: 'warning',
})
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/test/awsService/sagemaker/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('SageMaker Commands', () => {
// Setup test window to handle confirmation dialog
getTestWindow().onDidShowMessage((message) => {
if (message.message.includes(RemoteAccessRequiredMessage)) {
message.selectItem('Restart and Connect')
message.selectItem('Restart Space and Connect')
}
})

Expand Down Expand Up @@ -182,7 +182,7 @@ describe('SageMaker Commands', () => {
InstanceTypeInsufficientMemoryMessage('test-space', 'ml.t3.medium', 'ml.t3.large')
)
) {
message.selectItem('Restart and Connect')
message.selectItem('Restart Space and Connect')
}
})

Expand Down Expand Up @@ -236,8 +236,8 @@ describe('SageMaker Commands', () => {

// Setup test window to confirm
getTestWindow().onDidShowMessage((message) => {
if (message.items.some((item) => item.title === 'Restart and Connect')) {
message.selectItem('Restart and Connect')
if (message.items.some((item) => item.title === 'Restart Space and Connect')) {
message.selectItem('Restart Space and Connect')
}
})

Expand Down Expand Up @@ -337,7 +337,7 @@ describe('SageMaker Commands', () => {

// Verify no confirmation dialog shown for stopped space
const confirmMessages = getTestWindow().shownMessages.filter((m) =>
m.message.includes('Restart and Connect')
m.message.includes('Restart Space and Connect')
)
assert.strictEqual(confirmMessages.length, 0, 'Should not show confirmation for stopped space')

Expand Down Expand Up @@ -388,7 +388,7 @@ describe('SageMaker Commands', () => {
assert(mockTryRefreshNode.calledOnce)
// Verify no confirmation needed
const confirmMessages = getTestWindow().shownMessages.filter((m) =>
m.message.includes('Restart and Connect')
m.message.includes('Restart Space and Connect')
)
assert.strictEqual(confirmMessages.length, 0)
// Verify no space operations performed
Expand Down
11 changes: 7 additions & 4 deletions packages/core/src/test/shared/clients/sagemakerClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { DescribeDomainResponse } from '@amzn/sagemaker-client'
import { intoCollection } from '../../../shared/utilities/collectionUtils'
import { ToolkitError } from '../../../shared/errors'
import { getTestWindow } from '../vscode/window'
import { InstanceTypeInsufficientMemoryMessage } from '../../../awsService/sagemaker/constants'

describe('SagemakerClient.fetchSpaceAppsAndDomains', function () {
const region = 'test-region'
Expand Down Expand Up @@ -398,9 +399,10 @@ describe('SagemakerClient.startSpace', function () {

const promise = client.startSpace('my-space', 'my-domain')

// Wait for the error message to appear and select "Restart and Connect"
await getTestWindow().waitForMessage(/not supported for remote access/)
getTestWindow().getFirstMessage().selectItem('Restart and Connect')
// Wait for the error message to appear and select "Restart Space and Connect"
const expectedMessage = InstanceTypeInsufficientMemoryMessage('my-space', 'ml.t3.medium', 'ml.t3.large')
await getTestWindow().waitForMessage(new RegExp(expectedMessage.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
getTestWindow().getFirstMessage().selectItem('Restart Space and Connect')

await promise
sinon.assert.calledOnce(updateSpaceStub)
Expand All @@ -424,7 +426,8 @@ describe('SagemakerClient.startSpace', function () {
const promise = client.startSpace('my-space', 'my-domain')

// Wait for the error message to appear and select "Cancel"
await getTestWindow().waitForMessage(/not supported for remote access/)
const expectedMessage = InstanceTypeInsufficientMemoryMessage('my-space', 'ml.t3.medium', 'ml.t3.large')
await getTestWindow().waitForMessage(new RegExp(expectedMessage.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
getTestWindow().getFirstMessage().selectItem('Cancel')

await assert.rejects(promise, (err: ToolkitError) => err.message === 'InstanceType has insufficient memory.')
Expand Down
Loading