Skip to content

Nicer smoke test assertions#4141

Merged
trask merged 4 commits intomainfrom
nicer-smoke-test-assertions
Mar 19, 2025
Merged

Nicer smoke test assertions#4141
trask merged 4 commits intomainfrom
nicer-smoke-test-assertions

Conversation

@trask
Copy link
Copy Markdown
Member

@trask trask commented Mar 17, 2025

Easier to read, also more aligned with upstream OpenTelemetry which uses similar assertj wrappers

Comment on lines +27 to +56
testing.waitAndAssertTrace(
trace ->
trace
.hasRequestSatisying(
request ->
request
.hasName("GET /simple")
.hasSuccess(true)
.hasProperty("_MS.ProcessedByMetricExtractors", "True")
.hasTag("ai.operation.name", "GET /simple")
.hasNoParent())
.hasDependencySatisying(
dependency ->
dependency
.hasName("example.Greeter/SayHello")
.hasTarget("localhost:10203")
.hasSuccess(true)
.hasProperty("_MS.ProcessedByMetricExtractors", "True")
.hasTag("ai.operation.name", "GET /simple")
.hasParent(trace.getRequestId(0)))
.hasRequestSatisying(
request ->
request
.hasName("example.Greeter/SayHello")
.hasSuccess(true)
.hasProperty("_MS.ProcessedByMetricExtractors", "True")
.hasTag("ai.operation.name", "example.Greeter/SayHello")
.hasParent(trace.getDependencyId(0)))
// auto-collected grpc events are suppressed by exporter because they are noisy
.hasMessageCount(0));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what a test looks like with the new assertj wrappers

@trask trask marked this pull request as ready for review March 17, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants