Skip to content

Commit

Permalink
Update from master
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK Automation committed May 19, 2020
1 parent 97841de commit 1f19eca
Show file tree
Hide file tree
Showing 27 changed files with 3,578 additions and 2,392 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>CertificateRegistration_2019-08-01;DomainRegistration_2019-08-01;Web_2019-08-01;Web_2019-08-01;WebSiteManagementClient_2019-08-01;</AzureApiTag>
<AzureApiTag>CertificateRegistration_2018-02-01;DomainRegistration_2018-02-01;Web_2018-02-01;Web_2018-11-01;WebSiteManagementClient_2018-02-01;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<PackageId>Microsoft.Azure.Management.Websites</PackageId>
<Description>Provides website management capabilities for Microsoft Azure.</Description>
<AssemblyName>Microsoft.Azure.Management.Websites</AssemblyName>
<Version>3.0.0</Version>
<Version>2.2.0</Version>
<PackageTags>Microsoft Azure website management;website management;</PackageTags>
<PackageReleaseNotes><![CDATA[This is the Azure App Service SDK for .NET, based on the Azure App Service REST API, version 2019-08-01 of Certificates and Web Apps, and 2019-08-01 of all other resources]]></PackageReleaseNotes>
<PackageReleaseNotes><![CDATA[This is the Azure App Service SDK for .NET, based on the Azure App Service REST API, version 2018-11-01 of Certificates and Web Apps, and 2018-02-01 of all other resources]]></PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>$(SdkTargetFx)</TargetFrameworks>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

[assembly: Guid("4c6e3586-2ebd-4b86-b46e-6850c1f5226e")]

[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,77 @@ public void GetAndSetAdminSiteWebHostingPlan()
Assert.Equal("Standard", webHostingPlanResponse.Sku.Tier);
}
}

//[Fact(Skip = "Test does not work in playback mode due to key matching issue in test framework")]
[Fact(Skip="TODO: Fix datetime parsing in test to correctly handle UTC times and rerecord.")]
public void GetWebHostingPlanMetrics()
{
using (var context = MockContext.Start(this.GetType()))
{
var webSitesClient = this.GetWebSiteManagementClient(context);
var resourcesClient = this.GetResourceManagementClient(context);

string whpName = TestUtilities.GenerateName("csmsf");
string resourceGroupName = TestUtilities.GenerateName("csmrg");
var webSiteName = TestUtilities.GenerateName("csmws");
var serverfarmId = ResourceGroupHelper.GetServerFarmId(webSitesClient.SubscriptionId,
resourceGroupName, whpName);
var location = ResourceGroupHelper.GetResourceLocation(resourcesClient, "Microsoft.Web/sites");

resourcesClient.ResourceGroups.CreateOrUpdate(resourceGroupName,
new ResourceGroup
{
Location = location
});

webSitesClient.AppServicePlans.CreateOrUpdate(resourceGroupName, whpName,
new AppServicePlan()
{
Location = location,
Sku = new SkuDescription
{
Name = "S1",
Capacity = 1,
Tier = "Standard"
}
});

var webSite = webSitesClient.WebApps.CreateOrUpdate(resourceGroupName, webSiteName, new Site
{
Location = location,
Tags = new Dictionary<string, string> { { "tag1", "value1" }, { "tag2", "" } },
ServerFarmId = serverfarmId
});

var endTime = DateTime.Parse("2015-12-11T09:52:42Z");
var metricNames = new List<string> { "MemoryPercentage", "CpuPercentage", "DiskQueueLength", "HttpQueueLength", "BytesReceived", "BytesSent" };
metricNames.Sort();
var result = webSitesClient.AppServicePlans.ListMetrics(resourceGroupName: resourceGroupName,
name: whpName,
filter:
WebSitesHelper.BuildMetricFilter(startTime: endTime.AddDays(-1), endTime: endTime,
timeGrain: "PT1H", metricNames: metricNames), details: true);

webSitesClient.WebApps.Delete(resourceGroupName, webSiteName, deleteEmptyServerFarm: true);

var webHostingPlanResponse = webSitesClient.AppServicePlans.ListByResourceGroup(resourceGroupName);

Assert.Equal(0, webHostingPlanResponse.Count());

// Validate response
Assert.NotNull(result);
var actualmetricNames =
result.Select(r => r.Name.Value).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
actualmetricNames.Sort();
Assert.Equal(metricNames, actualmetricNames, StringComparer.OrdinalIgnoreCase);

// validate metrics only for replay since the metrics will not match
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
{
// TODO: Add playback mode assertions.
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,36 @@ public void CreateAndDeleteWebsite()
});
}

[Fact(Skip = "Deptecated API")]
//[Fact(Skip="TODO: Fix datetime parsing in test to properly handle universal time and rerecord.")]
public void GetSiteMetrics()
{
RunWebsiteTestScenario(
(webSiteName, resourceGroupName, whpName, locationName, webSitesClient, resourcesClient) =>
{
var endTime = DateTime.Parse("2018-01-28T00:23:02Z").ToUniversalTime();
var metricNames = new List<string> {"Requests", "CPU", "MemoryWorkingSet"};
metricNames.Sort();
var result = webSitesClient.WebApps.ListMetrics(resourceGroupName: resourceGroupName,
name: webSiteName, filter: WebSitesHelper.BuildMetricFilter(startTime: endTime.AddDays(-1), endTime: endTime, timeGrain: "PT1H", metricNames: metricNames), details: true);
webSitesClient.WebApps.Delete(resourceGroupName, webSiteName);
// Validate response
Assert.NotNull(result);
var actualmetricNames =
result.Select(r => r.Name.Value).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
actualmetricNames.Sort();
Assert.Equal(metricNames, actualmetricNames, StringComparer.OrdinalIgnoreCase);
// validate metrics only for replay since the metrics will not match
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
{
// TODO: Add playback mode assertions.
}
});
}

[Fact]
public void GetAndSetNonSensitiveSiteConfigs()
{
Expand Down Expand Up @@ -408,8 +438,8 @@ public void GetAndSetSiteLimits()
}
}

[Fact(Skip = "Test failing due to test issue. Needs further investigation")]
//[Fact]
//[Fact(Skip = "Test failing due to test issue. Needs further investigation")]
[Fact]
public void CloneSite()
{
RunWebsiteTestScenario(
Expand Down
Loading

0 comments on commit 1f19eca

Please sign in to comment.