Skip to content

Commit 74d362a

Browse files
committed
Addressing feedback from PR. Re-enabling the single skipped test case.
1 parent 8ae36bc commit 74d362a

File tree

11 files changed

+20
-18
lines changed

11 files changed

+20
-18
lines changed

src/ResourceManager/Insights/Commands.Insights.Test/ScenarioTests/MetricsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public MetricsTests(Xunit.Abstractions.ITestOutputHelper output)
2525
ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output));
2626
}
2727

28-
[Fact(Skip = "This is not failing locally, but it is failing in the build. Disabling temporarily.")]
28+
[Fact]
2929
[Trait(Category.AcceptanceType, Category.CheckIn)]
3030
public void TestGetMetrics()
3131
{

src/ResourceManager/Insights/Commands.Insights.Test/SessionRecords/Microsoft.Azure.Commands.Insights.Test.ScenarioTests.MetricsTests/TestGetMetrics.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"StatusCode": 200
2929
},
3030
{
31-
"RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/myWeb1/providers/microsoft.insights/metrics?$filter=(name.value%20eq%20'CPU'%20or%20name.value%20eq%20'Requests')%20and%20timeGrain%20eq%20duration'PT1M'%20and%20startTime%20eq%202015-03-23T22:00:00.0000000+00:00%20and%20endTime%20eq%202015-03-23T22:30:00.0000000+00:00%20and%20aggregationType%20eq%20'Count'&api-version=2016-09-01",
32-
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2ViLUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0LndlYi9zaXRlcy9teVdlYjEvcHJvdmlkZXJzL21pY3Jvc29mdC5pbnNpZ2h0cy9tZXRyaWNzPyRmaWx0ZXI9KG5hbWUudmFsdWUlMjBlcSUyMCdDUFUnJTIwb3IlMjBuYW1lLnZhbHVlJTIwZXElMjAnUmVxdWVzdHMnKSUyMGFuZCUyMHRpbWVHcmFpbiUyMGVxJTIwZHVyYXRpb24nUFQxTSclMjBhbmQlMjBzdGFydFRpbWUlMjBlcSUyMDIwMTUtMDMtMjNUMTU6MDA6MDAuMDAwMDAwMC0wNzowMCUyMGFuZCUyMGVuZFRpbWUlMjBlcSUyMDIwMTUtMDMtMjNUMTU6MzA6MDAuMDAwMDAwMC0wNzowMCUyMGFuZCUyMGFnZ3JlZ2F0aW9uVHlwZSUyMGVxJTIwJ0NvdW50JyZhcGktdmVyc2lvbj0yMDE2LTA5LTAx",
31+
"RequestUri": "/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/myWeb1/providers/microsoft.insights/metrics?$filter=(name.value%20eq%20'CPU'%20or%20name.value%20eq%20'Requests')%20and%20timeGrain%20eq%20duration'PT1M'%20and%20startTime%20eq%202015-03-23T22:00:00.0000000Z%20and%20endTime%20eq%202015-03-23T22:30:00.0000000Z%20and%20aggregationType%20eq%20'Count'&api-version=2016-09-01",
32+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGYwZGViYTEwZjRiL3Jlc291cmNlR3JvdXBzL0RlZmF1bHQtV2ViLUVhc3RVUy9wcm92aWRlcnMvbWljcm9zb2Z0LndlYi9zaXRlcy9teVdlYjEvcHJvdmlkZXJzL21pY3Jvc29mdC5pbnNpZ2h0cy9tZXRyaWNzPyRmaWx0ZXI9KG5hbWUudmFsdWUlMjBlcSUyMCdDUFUnJTIwb3IlMjBuYW1lLnZhbHVlJTIwZXElMjAnUmVxdWVzdHMnKSUyMGFuZCUyMHRpbWVHcmFpbiUyMGVxJTIwZHVyYXRpb24nUFQxTSclMjBhbmQlMjBzdGFydFRpbWUlMjBlcSUyMDIwMTUtMDMtMjNUMjI6MDA6MDAuMDAwMDAwMFolMjBhbmQlMjBlbmRUaW1lJTIwZXElMjAyMDE1LTAzLTIzVDIyOjMwOjAwLjAwMDAwMDBaJTIwYW5kJTIwYWdncmVnYXRpb25UeXBlJTIwZXElMjAnQ291bnQnJmFwaS12ZXJzaW9uPTIwMTYtMDktMDE=",
3333
"RequestMethod": "GET",
3434
"RequestBody": "",
3535
"RequestHeaders": {

src/ResourceManager/Insights/Commands.Insights/Alerts/AddAzureRmLogAlertRuleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private RuleCondition CreateRuleCondition()
8989

9090
protected override AlertRuleResource CreateSdkCallParameters()
9191
{
92-
WriteWarning("*** Add-AzureRMLogAlertRule cmdlet will be deprecated in future releases.");
92+
WriteWarning("*** Add-AzureRMLogAlertRule cmdlet will be deprecated in a future release.");
9393

9494
RuleCondition condition = this.CreateRuleCondition();
9595

src/ResourceManager/Insights/Commands.Insights/Alerts/GetAzureRmAlertRuleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static string ExtractTargetResourceId(AlertRuleResource alertRuleResourc
106106
/// </summary>
107107
protected override void ProcessRecordInternal()
108108
{
109-
WriteWarning("The output of this cmdlet will be flattened, i.e. elimination of the properties field, in future releases to improve the user experience.");
109+
WriteWarning("The output of this cmdlet will be flattened, i.e. elimination of the properties field, in a future release to improve the user experience.");
110110
if (string.IsNullOrWhiteSpace(this.Name))
111111
{
112112
// Retrieve all the AlertRules for a ResourceGroup

src/ResourceManager/Insights/Commands.Insights/Alerts/RemoveAzureRmAlertRuleCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class RemoveAzureRmAlertRuleCommand : ManagementCmdletBase
4949
/// </summary>
5050
protected override void ProcessRecordInternal()
5151
{
52-
WriteWarning("The type of the output will change in future releases to become a single object, not a list.");
52+
WriteWarning("The type of the output will change in a future release to become a single object, not a list.");
5353
var result = this.MonitorManagementClient.AlertRules.DeleteWithHttpMessagesAsync(resourceGroupName: this.ResourceGroup, ruleName: this.Name).Result;
5454

5555
// Keep this response for backwards compatibility.

src/ResourceManager/Insights/Commands.Insights/Autoscale/GetAzureRmAutoscaleSettingCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class GetAzureRmAutoscaleSettingCommand : ManagementCmdletBase
5959
/// </summary>
6060
protected override void ProcessRecordInternal()
6161
{
62-
WriteWarning("The AutoscaleSettingResourceName field will be deprecated in future versions since it always equals the Name field. In this version is optional.");
62+
WriteWarning("The AutoscaleSettingResourceName field will be deprecated in a future release since it always equals the Name field. In this version is optional.");
6363
if (string.IsNullOrWhiteSpace(this.Name))
6464
{
6565
// Retrieve all the Autoscale settings for a resource group

src/ResourceManager/Insights/Commands.Insights/LogProfiles/RemoveAzureRmLogProfileCommand.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ public class RemoveAzureRmLogProfileCommand : ManagementCmdletBase
3333
[ValidateNotNullOrEmpty]
3434
public string Name { get; set; }
3535

36+
[Parameter(Mandatory = false)]
37+
public SwitchParameter PassThru { get; set; }
38+
3639
#endregion
3740

3841
protected override void ProcessRecordInternal()
3942
{
40-
WriteWarning("The type of the output will change to follow the pattern from other similar operations.");
43+
WriteWarning("The type of the output will change to return a single object containing the request Id and the status code.");
4144
Rest.Azure.AzureOperationResponse result = this.MonitorManagementClient.LogProfiles.DeleteWithHttpMessagesAsync(logProfileName: this.Name, cancellationToken: CancellationToken.None).Result;
4245

4346
/*
@@ -49,7 +52,10 @@ protected override void ProcessRecordInternal()
4952
};
5053
*/
5154

52-
WriteObject(true);
55+
if (this.PassThru)
56+
{
57+
WriteObject(true);
58+
}
5359
}
5460
}
5561
}

src/ResourceManager/Insights/Commands.Insights/LogsCmdletBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ protected string ProcessParameters()
172172
{
173173
string queryFilter = this.ProcessGeneralParameters();
174174
var result = this.ProcessParticularParameters(queryFilter);
175-
WriteWarning("Deprecation: The field EventChannels from the EventData object is being deprecated since it is meaningless now. The value currently returned is constant.");
175+
WriteWarning("Deprecation: The field EventChannels from the EventData object is being deprecated since it now returns a constant value (Admin,Operation)");
176176
return result;
177177
}
178178

src/ResourceManager/Insights/Commands.Insights/Metrics/GetAzureRmMetricCommand.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected string ProcessParameters()
112112
// EndTime defaults to Now
113113
if (this.EndTime == default(DateTime))
114114
{
115-
this.EndTime = DateTime.Now;
115+
this.EndTime = DateTime.UtcNow;
116116
}
117117

118118
// StartTime defaults to EndTime - DefaultTimeRange (NOTE: EndTime defaults to Now)
@@ -122,9 +122,9 @@ protected string ProcessParameters()
122122
}
123123

124124
buffer.Append(" and startTime eq ");
125-
buffer.Append(this.StartTime.ToString("O"));
125+
buffer.Append(this.StartTime.ToUniversalTime().ToString("O"));
126126
buffer.Append(" and endTime eq ");
127-
buffer.Append(this.EndTime.ToString("O"));
127+
buffer.Append(this.EndTime.ToUniversalTime().ToString("O"));
128128

129129
if (this.AggregationType != null)
130130
{
@@ -148,8 +148,6 @@ protected string ProcessParameters()
148148
/// </summary>
149149
protected override void ProcessRecordInternal()
150150
{
151-
WriteWarning("**** This cmdlet has changed from the previous release: the call pattern and the output are different.");
152-
153151
string queryFilter = this.ProcessParameters();
154152
bool fullDetails = this.DetailedOutput.IsPresent;
155153

src/ResourceManager/Insights/Commands.Insights/Metrics/GetAzureRmMetricDefinitionCommand.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ protected string ProcessParameters()
7272
/// </summary>
7373
protected override void ProcessRecordInternal()
7474
{
75-
WriteWarning("*** This cmdlet has changed from the previous release: the call pattern and the output might be different.");
76-
7775
string queryFilter = this.ProcessParameters();
7876
bool fullDetails = this.DetailedOutput.IsPresent;
7977

src/ResourceManager/Insights/Commands.Insights/UsageMetrics/GetAzureRmUsageCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private static IEnumerable<PSUsageMetric> ExtractCollectionFromResult(IEnumerato
136136
/// </summary>
137137
protected override void ProcessRecordInternal()
138138
{
139-
WriteWarning("Get-AzureRmUsage will be deprecated in future releases.");
139+
WriteWarning("Get-AzureRmUsage will be deprecated in a future release.");
140140

141141
var queryFilter = new ODataQuery<UsageMetric>(this.ProcessParameters());
142142
string apiVersion = this.ApiVersion ?? DefaultApiVersion;

0 commit comments

Comments
 (0)