Skip to content

Commit 62267a8

Browse files
authored
[Azure.Monitor.Ingestion] update Bicep file for live testing (#31803)
1 parent 1802d31 commit 62267a8

15 files changed

+736
-645
lines changed

sdk/monitor/Azure.Monitor.Ingestion/tests/MonitorIngestionLiveTest.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private static List<Object> GenerateEntries(int numEntries, DateTime recordingNo
104104
[Test]
105105
public async Task ValidInputFromArrayAsJsonWithSingleBatchWithGzip()
106106
{
107-
LogsIngestionClient client = CreateClient();
107+
LogsIngestionClient client = CreateClient();
108108

109109
// Make the request
110110
var response = await client.UploadAsync(TestEnvironment.DCRImmutableId, TestEnvironment.StreamName, GenerateEntries(10, Recording.Now.DateTime)).ConfigureAwait(false);
@@ -119,28 +119,16 @@ public async Task ValidInputFromArrayAsJsonWithSingleBatchWithGzip()
119119
public async Task ValidInputFromArrayAsJsonWithMultiBatchWithGzip()
120120
{
121121
LogsIngestionClient client = CreateClient();
122+
LogsIngestionClient.SingleUploadThreshold = 500; // make batch size smaller for Uploads for test recording size
122123

123124
// Make the request
124-
var response = await client.UploadAsync(TestEnvironment.DCRImmutableId, TestEnvironment.StreamName, GenerateEntries(10000, Recording.Now.DateTime)).ConfigureAwait(false);
125+
var response = await client.UploadAsync(TestEnvironment.DCRImmutableId, TestEnvironment.StreamName, GenerateEntries(1000, Recording.Now.DateTime)).ConfigureAwait(false);
125126

126127
// Check the response
127128
Assert.AreEqual(UploadLogsStatus.Success, response.Value.Status);
128129
Assert.IsEmpty(response.Value.Errors);
129130
}
130131

131-
[LiveOnly]
132-
[Test]
133-
public async Task InvalidInputFromObjectAsJsonNoBatchingNoGzipAsync()
134-
{
135-
LogsIngestionClient client = CreateClient();
136-
137-
Response<UploadLogsResult> response = await client.UploadAsync(TestEnvironment.DCRImmutableId, TestEnvironment.StreamName, GenerateEntries(10000, Recording.Now.DateTime)).ConfigureAwait(false); //takes StreamName not tablename
138-
// Check the response - run without Batching and Gzip for error 413
139-
Assert.AreEqual(UploadLogsStatus.Failure, response.Value.Status);
140-
Assert.AreEqual(413, response.Value.Errors.FirstOrDefault().Error.Code);
141-
Assert.AreEqual(10000, response.Value.Errors.FirstOrDefault().FailedLogs.Count());
142-
}
143-
144132
[AsyncOnly]
145133
[Test]
146134
public async Task ConcurrencyMultiThread()
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
using System;
54
using Azure.Core.TestFramework;
6-
using Azure.Identity;
75

86
namespace Azure.Monitor.Ingestion.Tests
97
{
108
public class MonitorIngestionTestEnvironment : TestEnvironment
119
{
12-
public string DCRImmutableId => GetRecordedVariable("AZURE_MONITOR_INGESTION_LOGS_DCR_RULE_ID");
10+
public string DCRImmutableId => GetRecordedVariable("INGESTION_DATA_COLLECTION_RULE_IMMUTABLE_ID");
1311

14-
public string DCREndpoint => GetRecordedVariable("AZURE_MONITOR_INGESTION_DATA_COLLECTION_ENDPOINT");
12+
public string DCREndpoint => GetRecordedVariable("INGESTION_DATA_COLLECTION_ENDPOINT");
1513

16-
public string Ingestion_WorkspaceId => GetRecordedVariable("AZURE_MONITOR_INGESTION_INGESTION_WORKSPACE_ID");
14+
public string Ingestion_WorkspaceId => GetRecordedVariable("WORKSPACE_ID");
1715

18-
public string StreamName => GetRecordedVariable("AZURE_MONITOR_INGESTION_LOGS_DCR_STREAM_NAME");
16+
public string StreamName => GetRecordedVariable("INGESTION_STREAM_NAME");
1917

20-
public string TableName => GetRecordedVariable("AZURE_MONITOR_INGESTION_LOGS_TABLE_NAME");
18+
public string TableName => GetRecordedVariable("INGESTION_TABLE_NAME");
2119
}
2220
}

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/ConcurrencyMultiThreadAsync.json

Lines changed: 64 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/ConcurrencySingleThread.json

Lines changed: 349 additions & 349 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/EmptyData.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/EmptyDataAsync.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/NullInput.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/NullInputAsync.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/NullStream.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Ingestion/tests/SessionRecords/MonitorIngestionLiveTest/NullStreamAsync.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)