Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure App Service Manage Task - Refactor & Bug fixes #6001

Merged
merged 30 commits into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d3c53a8
Refactored Manage Task
vincent1173 Dec 10, 2017
04be72d
Fix WebTest Issue
vincent1173 Dec 10, 2017
b4dbdaf
Bug fixes #2
vincent1173 Dec 11, 2017
c89bef6
Addressed sachinm comments #1
vincent1173 Dec 11, 2017
0d9287b
add iterator
vincent1173 Dec 11, 2017
65523f0
added xml2js dependency
vincent1173 Dec 11, 2017
d7937d9
Addressed review comments #2
vincent1173 Dec 11, 2017
45f6968
bug Fix #3
vincent1173 Dec 12, 2017
0cd53e7
Added single L0 Test to check PR Build
vincent1173 Dec 12, 2017
501e104
addressed review comments #3
vincent1173 Dec 12, 2017
df44b6f
added retriable error codes - Kudu
vincent1173 Dec 13, 2017
7967150
added few tests to check PR Tests
vincent1173 Dec 14, 2017
c1aa868
Added L0 Test for azure-arm-app-service
vincent1173 Dec 14, 2017
364fa6c
L0 Tests added for App Service class
vincent1173 Dec 15, 2017
f633f77
res string updated
vincent1173 Dec 15, 2017
2c68d04
addressed few review comments
vincent1173 Dec 15, 2017
ddd2e42
Fix L0 Tests
vincent1173 Dec 15, 2017
509f72e
addressed review comments
vincent1173 Dec 18, 2017
62cce8f
site extension issue fix
vincent1173 Dec 18, 2017
5fea981
addressed review comments
vincent1173 Dec 18, 2017
ed9d19e
L0 Tests added
vincent1173 Dec 18, 2017
d5501c3
change BuildID to releaseID
vincent1173 Dec 19, 2017
f066868
removed irrelevant log statements
vincent1173 Dec 19, 2017
14f86b9
fixed error name
vincent1173 Dec 19, 2017
b18c310
Fix L0 Test
vincent1173 Dec 19, 2017
0454af4
Fix L0 Test
vincent1173 Dec 19, 2017
e7816b7
Format L0 Tests
vincent1173 Dec 20, 2017
7167c63
remove deployment ID
vincent1173 Dec 20, 2017
82b211f
Addressed review comments
vincent1173 Dec 20, 2017
a75bd76
addressed review comments
vincent1173 Dec 20, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"loc.messages.ExtensionAlreadyAvaiable": "Extension '%s' already available in Azure App Service.",
"loc.messages.ExtensionListFailedError": "Failed to retrieve list of extensions installed in Azure App Service. Error %s.",
"loc.messages.ExtensionListFailedResponseError": "Failed to retrieve list of extensions installed in Azure App Service. Status Code: %s",
"loc.messages.InstallingSiteExtension": "Installing site extension '%s' in Azure App Service.",
"loc.messages.FailedToFetchAppServiceState": "Failed to fetch App Service State for App Service: %s, Error Code: %s",
"loc.messages.UnableToFetchAuthorityURL": "Unable to fetch authority url.",
"loc.messages.UnableToFetchActiveDirectory": "Unable to fetch active directory resource id.",
Expand All @@ -78,5 +77,91 @@
"loc.messages.ResourceDoesntExist": "Resource '%s' doesn't exist. Resource should exist before deployment.",
"loc.messages.UnableToFetchContinuousWebJobs": "Unable to fetch continuous web jobs",
"loc.messages.UnableToStartContinuousWebJob": "Unable to start continuous web job",
"loc.messages.UnableToStopContinuousWebJob": "Unable to stop continuous web job"
"loc.messages.UnableToStopContinuousWebJob": "Unable to stop continuous web job",
"loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s",
"loc.messages.AppNameCannotBeNull": "App name cannot be null or undefined and it must be of type string.",
"loc.messages.SlotNameCannotBeNull": "Slot name cannot be null or undefined and it must be of type string.",
"loc.messages.SourceSlotNameCannotBeNull": "Source slot name cannot be null or undefined and it must be of type string.",
"loc.messages.DestinationSlotNameCannotBeNull": "Destination slot name cannot be null or undefined and it must be of type string.",
"loc.messages.ResourceGroupNotFound": "Rescource Group for '%s' app service not found.",
"loc.messages.ResourceTypeCannotBeNull": "Resource type cannot be null or undefined and it must be of type string.",
"loc.messages.StartedAppService": "App Service '%s' started successfully.",
"loc.messages.StartedAppServiceSlot": "App Service '%s-%s' started successfully.",
"loc.messages.FailedToStartAppService": "Failed to start App Service '%s'. Error: %s",
"loc.messages.FailedToStartAppServiceSlot": "Failed to start App Service '%s-%s'. Error: %s",
"loc.messages.StoppingAppServiceSlot": "Stopping App Service: %s-%s",
"loc.messages.StoppedAppService": "App Service '%s' stopped successfully.",
"loc.messages.StoppedAppServiceSlot": "App Service '%s-%s' stopped successfully.",
"loc.messages.FailedToStopAppService": "Failed to start App Service '%s'. Error: %s",
"loc.messages.FailedToStopAppServiceSlot": "Failed to start App Service '%s-%s'. Error: %s",
"loc.messages.RestartingAppServiceSlot": "Restarting App Service: %s-%s",
"loc.messages.RestartedAppService": "App Service '%s' restarted successfully.",
"loc.messages.RestartedAppServiceSlot": "App Service '%s-%s' restarted successfully.",
"loc.messages.FailedToRestartAppService": "Failed to restart App Service '%s'. Error: %s",
"loc.messages.FailedToRestartAppServiceSlot": "Failed to restart App Service '%s-%s'. Error: %s",
"loc.messages.FailedToGetAppServiceDetails": "Failed to fetch App Service '%s' details. Error: %s",
"loc.messages.FailedToGetAppServiceDetailsSlot": "Failed to fetch App Service '%s-%s' details. Error: %s",
"loc.messages.AppServiceState": "App Service is in '%s' state.",
"loc.messages.InvalidMonitorAppState": "Invalid state '%s' provided for monitoring app state",
"loc.messages.FailedToGetAppServicePublishingProfile": "Failed to fetch App Service '%s' publishing profile. Error: %s",
"loc.messages.FailedToGetAppServicePublishingProfileSlot": "Failed to fetch App Service '%s-%s' publishing profile. Error: %s",
"loc.messages.FailedToSwapAppServiceSlotWithProduction": "Failed to swap App Service '%s' slots - 'production' and '%s'. Error: %s",
"loc.messages.FailedToSwapAppServiceSlotSlots": "Failed to swap App Service '%s' slots - '%s' and '%s'. Error: %s",
"loc.messages.SwappingAppServiceSlotWithProduction": "Swapping App Service '%s' slots - 'production' and '%s'",
"loc.messages.SwappingAppServiceSlotSlots": "Swapping App Service '%s' slots - '%s' and '%s'",
"loc.messages.SwappedAppServiceSlotWithProduction": "Swapped App Service '%s' slots - 'production' and '%s'",
"loc.messages.SwappedAppServiceSlotSlots": "Swapped App Service '%s' slots - '%s' and '%s'",
"loc.messages.FailedToGetAppServicePublishingCredentials": "Failed to fetch App Service '%s' publishing credentials. Error: %s",
"loc.messages.FailedToGetAppServicePublishingCredentialsSlot": "Failed to fetch App Service '%s-%s' publishing credentials. Error: %s",
"loc.messages.WarmingUpSlots": "Warming-up slots",
"loc.messages.DeploymentIDCannotBeNull": "Deployment ID cannot be null or empty.",
"loc.messages.DeploymentDataEntityCannotBeNull": "Deployment data entity cannot be null or undefined.",
"loc.messages.SiteExtensionInstalled": "Site extension '%s' installed.",
"loc.messages.FailedToInstallSiteExtension": "Failed to install site extension '%s'. Error: %s",
"loc.messages.JobNameCannotBeNull": "Job name cannot be null or empty.",
"loc.messages.SiteExtensionCannotBeNull": "Site extension name cannot be null or empty.",
"loc.messages.TestNameCannotBeNull": "Test name cannot be null or undefined and it must be of type string.",
"loc.messages.TestDefinitionCannotBeNull": "Test definition cannot be null or undefined.",
"loc.messages.AppInsightsPropertiesCannotBeNullOrEmpty": "Application Insights properties cannot be null or undefined.",
"loc.messages.SpecifiedAzureRmEndpointIsInvalid": "Specified AzureRM Endpoint is invalid: %s",
"loc.messages.FailedToFetchAzureStackDependencyData": "Failed to fetch Azure stack dependency data. Status code: %s",
"loc.messages.FailedToGetApplicationInsightsResource": "Failed to get Application Insights '%s' Resource. Error: %s",
"loc.messages.FailedToUpdateApplicationInsightsResource": "Failed to update Application Insights '%s' Resource. Error: %s",
"loc.messages.FailedToGetApplicationInsightsWebTestsForResourceGroup": "Failed to get Application Insights Web TestsFor Resource Group '%s'. Error: %s",
"loc.messages.FailedToCreateWebTests": "Failed to create Web Test. Error: %s",
"loc.messages.WebTestAlreadyConfigured": "Web Test already configured for URL: %s",
"loc.messages.FailedToGetAppServiceConfiguration": "Failed to get App service '%s' configuration. Error: %s",
"loc.messages.FailedToGetAppServiceConfigurationSlot": "Failed to get App service '%s-%s' configuration. Error: %s",
"loc.messages.FailedToUpdateAppServiceConfiguration": "Failed to update App service '%s' configuration. Error: %s",
"loc.messages.FailedToUpdateAppServiceConfigurationSlot": "Failed to update App service '%s-%s' configuration. Error: %s",
"loc.messages.FailedToGetAppServiceApplicationSettings": "Failed to get App service '%s' application settings. Error: %s",
"loc.messages.FailedToGetAppServiceApplicationSettingsSlot": "Failed to get App service '%s-%s' application settings. Error: %s",
"loc.messages.FailedToUpdateAppServiceApplicationSettings": "Failed to update App service '%s' application settings. Error: %s",
"loc.messages.FailedToUpdateAppServiceApplicationSettingsSlot": "Failed to update App service '%s-%s' application settings. Error: %s",
"loc.messages.KuduSCMDetailsAreEmpty": "KUDU SCM details are empty",
"loc.messages.FailedToGetContinuousWebJobs": "Failed to get continuous WebJobs. Error: %s",
"loc.messages.FailedToStartContinuousWebJob": "Failed to start continuous WebJob '%s'. Error: %s",
"loc.messages.FailedToStopContinuousWebJob": "Failed to stop continuous WebJob '%s'. Error: %s",
"loc.messages.FailedToGetSiteExtensions": "Failed to get site extensions. Error: %s",
"loc.messages.ExtensionAlreadyInstalled": "Extension '%s' already installed.",
"loc.messages.InstallingSiteExtension": "Installing site Extension '%s'",
"loc.messages.FailedToGetResourceID": "Failed to get resource ID for resource type '%s' and resource name '%s'. Error: %s",
"loc.messages.ContinousMonitoringEnabled": "Continuous Monitoring enabled for App Service '%s'.",
"loc.messages.MultipleResourceGroupFoundForAppService": "Multiple resource group found for App Service '%s'.",
"loc.messages.StartingContinousWebJobs": "Starting continuous WebJobs",
"loc.messages.StartedContinousWebJobs": "Started continuous WebJobs.",
"loc.messages.StoppingContinousWebJobs": "Stopping continuous WebJobs.",
"loc.messages.StoppedContinousWebJobs": "Stopped continuous WebJobs.",
"loc.messages.FailedToEnableContinuousMonitoring": "Failed to enable continuous monitoring. Error: %s",
"loc.messages.InvalidSlotSwapEntity": "Invalid Slot swap entity. Error: %s",
"loc.messages.FailedToUpdateDeploymentHistory": "Failed to update Deployment status. Error: %s",
"loc.messages.StartingWebJob": "Starting WebJob '%s'.",
"loc.messages.StartedWebJob": "WebJob '%s' started.",
"loc.messages.WebJobAlreadyInRunningState": "WebJob '%s' is already in running state.",
"loc.messages.StoppingWebJob": "Stopping WebJob '%s'.",
"loc.messages.StoppedWebJob": "WebJob '%s' stopped.",
"loc.messages.WebJobAlreadyInStoppedState": "WebJob '%s' is already in stopped state.",
"loc.messages.RestartingKuduService": "Restarting Kudu Service.",
"loc.messages.RestartedKuduService": "Kudu Service restarted.",
"loc.messages.FailedToRestartKuduService": "Failed to restart kudu Service. %s."
}
45 changes: 22 additions & 23 deletions Tasks/AzureAppServiceManage/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,32 @@ import * as assert from 'assert';
import * as ttm from 'vsts-task-lib/mock-test';
import tl = require('vsts-task-lib');
import * as path from 'path';

var AppServiceTests = require("../node_modules/azure-arm-rest/Tests/L0-azure-arm-app-service.js");
var KuduServiceTests = require("../node_modules/azure-arm-rest/Tests/L0-azure-arm-app-service-kudu-tests.js");
var ApplicationInsightsTests = require("../node_modules/azure-arm-rest/Tests/L0-azure-arm-appinsights-tests.js");
var AppInsightsWebTests = require("../node_modules/azure-arm-rest/Tests/L0-azure-arm-appinsights-webtests-tests.js");
describe('Azure App Service Manage Suite', function() {
it('Install Extensions successfully', (done:MochaDone) => {
let tp = path.join(__dirname, 'L0ExtensionManageSuccess.js');
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();

assert(tr.succeeded, 'task should have succeeded');
assert(tr.stdOutContained('Retrieved list of extensions already available in Azure App Service.'), 'Should have retrieved extensions already avaliable in Azure App Service.');
assert(tr.stdOutContained('InstallingSiteExtension python2713x86'), 'Should have tried to Install extension.');
assert(tr.stdOutContained('ExtensionInstallSuccess Python 2.7.13 x86'), 'Should have installed extension successfully.');
done();
});
it('Return error when List Extension fails', (done:MochaDone) => {
let tp = path.join(__dirname, 'L0ExtensionManageListFail.js');
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
this.timeout(60000);

assert(tr.stdOutContained('ExtensionListFailedResponseError'), 'Should have failed when extension list failed.');
done();
});
it('Return error when Extension install fails', (done:MochaDone) => {
let tp = path.join(__dirname, 'L0ExtensionManageInstallFail.js');
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
before((done) => {
try {
if(!tl.exist(path.join(__dirname, '..', 'node_modules/azure-arm-rest/Tests/node_modules'))) {
tl.cp(path.join( __dirname, 'node_modules'), path.join(__dirname, '..', 'node_modules/azure-arm-rest/Tests'), '-rf', true);
}
}
catch(error) {
tl.debug(error);
}

assert(tr.stdOutContained('ExtensionInstallFailedResponseError'), 'Should have failed when extension install failed.');
done();
});

after(function () {
});

ApplicationInsightsTests.ApplicationInsightsTests();
AppServiceTests.AzureAppServiceMockTests();
KuduServiceTests.KuduServiceTests();
AppInsightsWebTests.ApplicationInsightsTests();
});

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions Tasks/AzureAppServiceManage/Tests/L0ExtensionManageSuccess.ts

This file was deleted.

65 changes: 0 additions & 65 deletions Tasks/AzureAppServiceManage/Tests/L0ExtensionMangeUtility.ts

This file was deleted.

Loading