Skip to content

Commit

Permalink
WIP testing for http-client
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlauer1 committed May 21, 2024
1 parent c2ea53f commit 6b1baaa
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion instrumentation/http-client/test/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
import Network.HTTP.Client (Request (requestHeaders), defaultRequest)
import qualified OpenTelemetry.Context as Context
import OpenTelemetry.Instrumentation.HttpClient.Raw (httpTracerProvider, instrumentRequest)
import OpenTelemetry.Propagator
import OpenTelemetry.Trace.Core (getTracerProviderPropagators, getTracerTracerProvider)
import Test.Hspec


main :: IO ()
main = putStrLn "Test suite not yet implemented"
main = hspec $ do
describe "OpenTelemetry.Instrumentation.HttpClient" $ do
describe "Raw" $ do
describe "instrumentRequest" $ do
specify "Request has the correct attributes" $ do
request <- instrumentRequest mempty Context.empty defaultRequest
tracer <- httpTracerProvider
context <- extract (getTracerProviderPropagators $ getTracerTracerProvider $ tracer) (requestHeaders request) Context.empty
let maybeAttributes = Context.lookupSpan context
pending

0 comments on commit 6b1baaa

Please sign in to comment.