Skip to content

Commit 248c671

Browse files
ric-olivclaude
andauthored
test(log4net): Run the configuration binding tests against log4net 3 (#5651)
The V3 test project links the other test files added in #5592, but not SentryAppenderConfigurationBindingTests. That file didn't compile against log4net 3, which marks the XmlElement parameter of XmlConfigurator.Configure as non-nullable. With a null-forgiving operator on DocumentElement it compiles, so the V3 project now links it and the Dsn tombstone behavior is pinned on both log4net versions. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9999e9a commit 248c671

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎test/Sentry.Log4Net.Tests/SentryAppenderConfigurationBindingTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void OnLogReceived(object? sender, LogReceivedEventArgs e)
3939
try
4040
{
4141
var repository = LogManager.CreateRepository(Guid.NewGuid().ToString());
42-
var exception = Record.Exception(() => XmlConfigurator.Configure(repository, document.DocumentElement));
42+
var exception = Record.Exception(() => XmlConfigurator.Configure(repository, document.DocumentElement!));
4343
return (exception, repository.GetAppenders().Length, string.Join(" | ", errors));
4444
}
4545
finally

‎test/Sentry.Log4Net.V3.Tests/Sentry.Log4Net.V3.Tests.csproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<DependentUpon>SentryAppenderTests.cs</DependentUpon>
1313
</Compile>
1414
<Compile Include="..\Sentry.Log4Net.Tests\SentryAppenderUninitializedSdkTests.cs" Link="SentryAppenderUninitializedSdkTests.cs" />
15+
<Compile Include="..\Sentry.Log4Net.Tests\SentryAppenderConfigurationBindingTests.cs" Link="SentryAppenderConfigurationBindingTests.cs" />
1516
</ItemGroup>
1617

1718
<ItemGroup>

0 commit comments

Comments
 (0)