Skip to content

Commit 0ea3cee

Browse files
authored
test: Integration test regex updates (#2958)
Updates some of the log regex patterns we use in integration tests to a little bit less specific.
1 parent b8e8b2d commit 0ea3cee

5 files changed

+6
-6
lines changed

tests/Agent/IntegrationTests/IntegrationTestHelpers/AgentLogBase.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class AgentLogBase
4444
public const string CustomEventDataLogLineRegex = DebugLogLinePrefixRegex + @"Request\(.{36}\): Invoked ""custom_event_data"" with : (.*)";
4545

4646
// Collector responses
47-
public const string ConnectResponseLogLineRegex = DebugLogLinePrefixRegex + @"Request\(.{36}\): Invocation of ""connect"" yielded response : {""return_value"":{""agent_run_id""(.*)";
47+
public const string ConnectResponseLogLineRegex = DebugLogLinePrefixRegex + @"Request\(.{36}\): Invocation of ""connect"" yielded response : {""return_value"":(.*)";
4848
public const string ErrorResponseLogLinePrefixRegex = ErrorLogLinePrefixRegex + @"Request\(.{36}\): ";
4949

5050
public const string ThreadProfileStartingLogLineRegex = InfoLogLinePrefixRegex + @"Starting a thread profiling session";
@@ -496,7 +496,7 @@ public IEnumerable<ConnectResponseData> GetConnectResponseDatas()
496496

497497
foreach (var match in matches)
498498
{
499-
var json = "{ \"agent_run_id\"" + match;
499+
var json = match;
500500
json = json?.Trim('[', ']');
501501
json = json.Remove(json.Length - 1); // remove the extra }
502502

tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMDisabledAndServerSideHSMEnabledTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void Test()
4141
{
4242
// This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail.
4343
// 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back.
44-
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?");
44+
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict *?");
4545
Assert.NotNull(notConnectedLogLine);
4646
}
4747
}

tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMEnabledAndServerSideHSMDisabledTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void Test()
4949
{
5050
// This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail.
5151
// 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back.
52-
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?");
52+
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict *?");
5353
Assert.NotNull(notConnectedLogLine);
5454
}
5555
}

tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerDisabled.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void Test()
4646
{
4747
// This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail.
4848
// 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back.
49-
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?");
49+
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict *?");
5050
Assert.NotNull(notConnectedLogLine);
5151
}
5252
}

tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerEnabled.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void Test()
4444
{
4545
// This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail.
4646
// 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back.
47-
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?");
47+
var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict *?");
4848
Assert.NotNull(notConnectedLogLine);
4949
}
5050
}

0 commit comments

Comments
 (0)