diff --git a/instrumentation/http-client/test/Spec.hs b/instrumentation/http-client/test/Spec.hs index 02b7d6e3..73823850 100644 --- a/instrumentation/http-client/test/Spec.hs +++ b/instrumentation/http-client/test/Spec.hs @@ -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 \ No newline at end of file