Skip to content

Commit

Permalink
Merge pull request #29 from Kielek/drop-otel.status-missing-test-files
Browse files Browse the repository at this point in the history
Replace otel.status_code and otel.status_description by Activity.Status - adjust tests
  • Loading branch information
jbogard authored May 20, 2024
2 parents 7ce5c51 + dd15301 commit 3aeb228
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 3aeb228

Please sign in to comment.