Add EventFilter + semantic logging test coverage#8046
Merged
Aaronontheweb merged 2 commits intoakkadotnet:devfrom Feb 16, 2026
Merged
Conversation
Add comprehensive test coverage for EventFilter matching against semantic log messages (named templates). Covers exact match, partial matchers, null handling, decimal precision, type variety, and end-to-end Logger.Info() scenarios through the real adapter path. - EventFilterSemanticLoggingTests: 26 integration tests for EventFilter with SemanticLogMessageFormatter including customer-reported scenario where converting from positional to named templates changed output - SemanticFormatterNullAndEdgeCaseSpecs: 32 unit tests for formatter edge cases (decimal trailing zeros, nullable types, null rendering, format specifiers, LogValues boxing) - Document null rendering asymmetry in SemanticLogMessageFormatter XML docs (named: "null", positional: "" via string.Format)
Reproduces exact customer scenario where actor arithmetic produces 100.0m but test EventFilter uses 100m via string interpolation. Demonstrates three workarounds: contains: partial match, matching exact precision, and F2/F0 format specifiers in named templates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EventFilterSemanticLoggingTests) verifyingEventFiltercorrectly matches semantic log messages with named templates ({PropertyName}style)SemanticFormatterNullAndEdgeCaseSpecs) coveringSemanticLogMessageFormatteredge cases: decimal trailing zeros, nullable types, null rendering, format specifiers,LogValues<T>boxingSemanticLogMessageFormatterXML docs: named templates rendernullas"null"(per Message Templates spec), positional templates rendernullas""(viastring.Format)Key scenarios covered
:fformat specifiers to named templates changes decimal formatting output (e.g.,{4:f}→"100.00"vs{Amount}→"100.0"for100.0m). Includes reproduction test with workarounds (contains:, format specifiers)ILoggingAdapter→BusLogging→SemanticLogMessageFormatterchain, not just manually constructedLogMessageinstancesSemanticLogMessageFormatteras the system formatterTest plan
dotnet test src/core/Akka.Tests/Akka.Tests.csproj -c Release --framework net8.0 --filter "FullyQualifiedName~SemanticFormatterNullAndEdgeCaseSpecs"— 32 passeddotnet test src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj -c Release --framework net8.0 --filter "FullyQualifiedName~EventFilterSemanticLoggingTests"— 28 passed