From dd15301156685021ed089bf34f6b05d32067a7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Wed, 15 May 2024 07:06:05 +0200 Subject: [PATCH] Replace otel.status_code and otel.status_description by Activity.Status - adjust tests --- .../DiagnosticsActivityEventSubscriberTests.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/MongoDB.Driver.Core.Extensions.DiagnosticSources.Tests/DiagnosticsActivityEventSubscriberTests.cs b/tests/MongoDB.Driver.Core.Extensions.DiagnosticSources.Tests/DiagnosticsActivityEventSubscriberTests.cs index b254e7a..ac7895e 100644 --- a/tests/MongoDB.Driver.Core.Extensions.DiagnosticSources.Tests/DiagnosticsActivityEventSubscriberTests.cs +++ b/tests/MongoDB.Driver.Core.Extensions.DiagnosticSources.Tests/DiagnosticsActivityEventSubscriberTests.cs @@ -96,7 +96,7 @@ public void Should_start_and_log_successful_activity() { activity.ShouldNotBeNull(); activity.OperationName.ShouldBe(DiagnosticsActivityEventSubscriber.ActivityName); - activity.Status.ShouldBe(ActivityStatusCode.Ok); + activity.Status.ShouldBe(ActivityStatusCode.Unset); stopFired = true; } }; @@ -135,9 +135,6 @@ public void Should_start_and_log_failed_activity() { activity.ShouldNotBeNull(); activity.OperationName.ShouldBe(DiagnosticsActivityEventSubscriber.ActivityName); - var statusTag = activity.Tags.SingleOrDefault(t => t.Key == "otel.status_code"); - statusTag.ShouldNotBe(default); - statusTag.Value.ShouldBe("ERROR"); activity.Status.ShouldBe(ActivityStatusCode.Error); exceptionFired = true; } @@ -193,7 +190,7 @@ public void Should_record_all_data() activity.Tags.SingleOrDefault(t => t.Key == "db.statement").ShouldBe(default); activity.Tags.SingleOrDefault(t => t.Key == "server.address").Value.ShouldBe("localhost"); activity.Tags.SingleOrDefault(t => t.Key == "server.port").Value.ShouldBe("8000"); - activity.Tags.SingleOrDefault(t => t.Key == "otel.status_code").Value.ShouldBe("OK"); + activity.Status.ShouldBe(ActivityStatusCode.Unset); stopFired = true; }