mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
refactor tests to avoid circular dependencies
This commit is contained in:
parent
db45d9ff56
commit
6bf49dc050
17 changed files with 30 additions and 58 deletions
40
dune-project
40
dune-project
|
|
@ -30,14 +30,6 @@
|
|||
ambient-context
|
||||
(odoc :with-doc)
|
||||
(alcotest :with-test)
|
||||
(opentelemetry-client-cohttp-lwt
|
||||
(and
|
||||
:with-test
|
||||
(= :version)))
|
||||
(opentelemetry-client-ocurl
|
||||
(and
|
||||
:with-test
|
||||
(= :version)))
|
||||
(pbrt
|
||||
(>= 2.3))
|
||||
(ocaml-lsp-server :with-dev-setup)
|
||||
|
|
@ -70,15 +62,7 @@
|
|||
(>= "5.3"))
|
||||
(lwt_ppx
|
||||
(>= "2.0"))
|
||||
(alcotest :with-test)
|
||||
(opentelemetry-client-cohttp-lwt
|
||||
(and
|
||||
:with-test
|
||||
(= :version)))
|
||||
(opentelemetry-client-ocurl
|
||||
(and
|
||||
:with-test
|
||||
(= :version))))
|
||||
(alcotest :with-test))
|
||||
(tags
|
||||
(instrumentation tracing opentelemetry datadog lwt)))
|
||||
|
||||
|
|
@ -99,11 +83,7 @@
|
|||
(ezcurl
|
||||
(>= 0.2.3))
|
||||
ocurl
|
||||
(alcotest :with-test)
|
||||
(opentelemetry-client-cohttp-lwt
|
||||
(and
|
||||
:with-test
|
||||
(= :version))))
|
||||
(alcotest :with-test))
|
||||
(synopsis "Collector client for opentelemetry, using http + ezcurl"))
|
||||
|
||||
(package
|
||||
|
|
@ -120,15 +100,7 @@
|
|||
(>= "5.3"))
|
||||
(cohttp-lwt
|
||||
(>= "4.0.0"))
|
||||
(alcotest :with-test)
|
||||
(opentelemetry-client-cohttp-lwt
|
||||
(and
|
||||
:with-test
|
||||
(= :version)))
|
||||
(opentelemetry-client-ocurl
|
||||
(and
|
||||
:with-test
|
||||
(= :version))))
|
||||
(alcotest :with-test))
|
||||
(synopsis "Opentelemetry tracing for Cohttp HTTP servers"))
|
||||
|
||||
(package
|
||||
|
|
@ -150,9 +122,5 @@
|
|||
(>= "2.0"))
|
||||
cohttp-lwt
|
||||
cohttp-lwt-unix
|
||||
(alcotest :with-test)
|
||||
(opentelemetry-client-ocurl
|
||||
(and
|
||||
:with-test
|
||||
(= :version))))
|
||||
(alcotest :with-test))
|
||||
(synopsis "Collector client for opentelemetry, using cohttp + lwt"))
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ depends: [
|
|||
"cohttp-lwt"
|
||||
"cohttp-lwt-unix"
|
||||
"alcotest" {with-test}
|
||||
"opentelemetry-client-ocurl" {with-test & = version}
|
||||
]
|
||||
build: [
|
||||
["dune" "subst"] {dev}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ depends: [
|
|||
"ezcurl" {>= "0.2.3"}
|
||||
"ocurl"
|
||||
"alcotest" {with-test}
|
||||
"opentelemetry-client-cohttp-lwt" {with-test & = version}
|
||||
]
|
||||
build: [
|
||||
["dune" "subst"] {dev}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ depends: [
|
|||
"lwt" {>= "5.3"}
|
||||
"cohttp-lwt" {>= "4.0.0"}
|
||||
"alcotest" {with-test}
|
||||
"opentelemetry-client-cohttp-lwt" {with-test & = version}
|
||||
"opentelemetry-client-ocurl" {with-test & = version}
|
||||
]
|
||||
build: [
|
||||
["dune" "subst"] {dev}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ depends: [
|
|||
"lwt" {>= "5.3"}
|
||||
"lwt_ppx" {>= "2.0"}
|
||||
"alcotest" {with-test}
|
||||
"opentelemetry-client-cohttp-lwt" {with-test & = version}
|
||||
"opentelemetry-client-ocurl" {with-test & = version}
|
||||
]
|
||||
build: [
|
||||
["dune" "subst"] {dev}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ depends: [
|
|||
"ambient-context"
|
||||
"odoc" {with-doc}
|
||||
"alcotest" {with-test}
|
||||
"opentelemetry-client-cohttp-lwt" {with-test & = version}
|
||||
"opentelemetry-client-ocurl" {with-test & = version}
|
||||
"pbrt" {>= "2.3"}
|
||||
"ocaml-lsp-server" {with-dev-setup}
|
||||
"ocamlformat" {with-dev-setup & >= "0.24" & < "0.25"}
|
||||
|
|
|
|||
4
tests/cohttp/dune
Normal file
4
tests/cohttp/dune
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(tests
|
||||
(names test_get_url)
|
||||
(package opentelemetry-client-cohttp-lwt)
|
||||
(libraries opentelemetry opentelemetry-client-cohttp-lwt))
|
||||
|
|
@ -1,2 +1 @@
|
|||
ocurl url = http://localhost:3000
|
||||
cohttp url = http://localhost:3000
|
||||
|
|
@ -1,17 +1,9 @@
|
|||
let url = "http://localhost:3000"
|
||||
|
||||
let ocurl () =
|
||||
let config = Opentelemetry_client_ocurl.Config.make ~url () in
|
||||
Opentelemetry_client_ocurl.with_setup ~config () @@ fun () ->
|
||||
let url = Opentelemetry_client_ocurl.get_url () in
|
||||
print_endline @@ Printf.sprintf "ocurl url = %s" url
|
||||
|
||||
let cohttp () =
|
||||
let config = Opentelemetry_client_cohttp_lwt.Config.make ~url () in
|
||||
Opentelemetry_client_cohttp_lwt.with_setup ~config () @@ fun () ->
|
||||
let url = Opentelemetry_client_cohttp_lwt.get_url () in
|
||||
print_endline @@ Printf.sprintf "cohttp url = %s" url
|
||||
|
||||
let () =
|
||||
ocurl ();
|
||||
cohttp ()
|
||||
let () = cohttp ()
|
||||
5
tests/core/dune
Normal file
5
tests/core/dune
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
(tests
|
||||
(names test_trace_context )
|
||||
(package opentelemetry)
|
||||
(libraries opentelemetry))
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
(tests
|
||||
(names test_trace_context test_get_url)
|
||||
(libraries opentelemetry opentelemetry-client-ocurl
|
||||
opentelemetry-client-cohttp-lwt))
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
(tests
|
||||
(names test_implicit_scope_sync)
|
||||
(package opentelemetry-client-cohttp-lwt)
|
||||
(libraries alcotest opentelemetry opentelemetry-client-cohttp-lwt))
|
||||
|
|
|
|||
5
tests/ocurl/dune
Normal file
5
tests/ocurl/dune
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
(tests
|
||||
(names test_get_url)
|
||||
(package opentelemetry-client-ocurl)
|
||||
(libraries opentelemetry opentelemetry-client-ocurl))
|
||||
1
tests/ocurl/test_get_url.expected
Normal file
1
tests/ocurl/test_get_url.expected
Normal file
|
|
@ -0,0 +1 @@
|
|||
ocurl url = http://localhost:3000
|
||||
9
tests/ocurl/test_get_url.ml
Normal file
9
tests/ocurl/test_get_url.ml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let url = "http://localhost:3000"
|
||||
|
||||
let ocurl () =
|
||||
let config = Opentelemetry_client_ocurl.Config.make ~url () in
|
||||
Opentelemetry_client_ocurl.with_setup ~config () @@ fun () ->
|
||||
let url = Opentelemetry_client_ocurl.get_url () in
|
||||
print_endline @@ Printf.sprintf "ocurl url = %s" url
|
||||
|
||||
let () = ocurl ()
|
||||
Loading…
Add table
Reference in a new issue