Skip to content

Commit

Permalink
Add a test for zip file deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nturinski committed Feb 12, 2024
1 parent e4eec77 commit dd5602d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions test/nightly/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface ITestCase {
workspaceFolder: string | undefined;
runtimePrefix: string;
versions: IVersionInfo[];
zipFile?: string | undefined;
}

interface IVersionInfo {
Expand Down Expand Up @@ -55,6 +56,14 @@ suite('Create Web App and deploy', function (this: Mocha.Suite): void {
{ version: '16', supportedAppOs: 'Both', displayText: '16 LTS' }
]
},
{
runtimePrefix: 'Node',
workspaceFolder: 'testFolder',
zipFile: 'node-hello-1.zip',
versions: [
{ version: '16', supportedAppOs: 'Both', displayText: '16 LTS' }
]
},
{
runtimePrefix: '.NET',
workspaceFolder: undefined,
Expand Down Expand Up @@ -111,7 +120,7 @@ suite('Create Web App and deploy', function (this: Mocha.Suite): void {
});
}

async function testCreateWebAppAndDeploy(os: string, promptForOs: boolean, runtime: string, workspacePath: string, expectedVersion: string): Promise<void> {
async function testCreateWebAppAndDeploy(os: string, promptForOs: boolean, runtime: string, workspacePath: string, expectedVersion: string, zipFile?: string): Promise<void> {
const resourceName: string = getRandomHexString();
const resourceGroupName = getRandomHexString();
resourceGroupsToDelete.push(resourceGroupName);
Expand All @@ -132,8 +141,13 @@ suite('Create Web App and deploy', function (this: Mocha.Suite): void {
assert.ok(createdApp);

await runWithTestActionContext('Deploy', async context => {

await context.ui.runWithInputs([workspacePath, resourceName, 'Deploy'], async () => {
await deploy(context);
if (zipFile) {
await vscode.commands.executeCommand('appService.Deploy', vscode.Uri.file(path.join(workspacePath, zipFile)), undefined, true /*isNewApp*/);
} else {
await deploy(context);
}
});
});

Expand Down
Binary file added test/nightly/testFolder/node-hello-1.zip
Binary file not shown.

0 comments on commit dd5602d

Please sign in to comment.