test: redact current ocaml version from signal-gatherer output

this should make expect tests more robust.
This commit is contained in:
Simon Cruanes 2025-12-27 21:48:28 -05:00
parent 5622d81ae7
commit 979a3ab3c8
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 9 additions and 2 deletions

View file

@ -134,7 +134,14 @@ let run ?(port = default_port) () : _ Lwt.t =
Lwt_stream.iter_s
(fun s ->
let open Lwt.Syntax in
let* () = Lwt_io.printl (Format.asprintf "%a" Signal.Pp.pp s) in
let printed = Format.asprintf "%a" Signal.Pp.pp s in
(* redact current ocaml version, for expect tests *)
let printed =
CCString.replace ~which:`All ~sub:Sys.ocaml_version
~by:"ocaml_version" printed
in
let* () = Lwt_io.printl printed in
Lwt_io.flush Lwt_io.stdout)
stream;
]

View file

@ -19,7 +19,7 @@
[{ scope =
Some(
{ name = "ocaml-otel";
version = "<fixed>";
version = "%%VERSION_NUM%%";
attributes = [];
dropped_attributes_count = 0 (* absent *);
});