diff --git a/bench/report/runs.ml b/bench/report/runs.ml index 033f96b0e..27c08b5cf 100644 --- a/bench/report/runs.ml +++ b/bench/report/runs.ml @@ -100,6 +100,26 @@ let pp_quick_results fmt results = "Nothing: %6i Reached: %6i Timeout: %6i Other: %6i Killed: %6i" !nothing !reached !timeout !other !killed +let pp_table fmt results = + let nothing = ref 0 in + let reached = ref 0 in + let timeout = ref 0 in + let killed = ref 0 in + let other = ref 0 in + List.iter + (fun result -> + match result.Run.res with + | Nothing _ -> incr nothing + | Reached _ -> incr reached + | Timeout _ -> incr timeout + | Signaled _ | Stopped _ -> incr killed + | Other _ -> incr other ) + results; + Format.fprintf fmt + "| Nothing | Reached | Timeout | Other | Killed |@\n\ + |:-------:|:-------:|:-------:|:-----:|:------:|@\n\ + | %6i | %6i | %6i | %6i | %6i |" !nothing !reached !timeout !other !killed + let map = List.map let files = List.map (fun run -> run.Run.file) diff --git a/bench/report/runs.mli b/bench/report/runs.mli index 884bff1a5..a915da538 100644 --- a/bench/report/runs.mli +++ b/bench/report/runs.mli @@ -48,6 +48,8 @@ val to_distribution : max_time:int -> t -> float list val pp_quick_results : Format.formatter -> t -> unit +val pp_table : Format.formatter -> t -> unit + val map : (Run.t -> 'a) -> t -> 'a list val files : t -> Fpath.t list diff --git a/bench/testcomp/testcomp.ml b/bench/testcomp/testcomp.ml index 4f561ec28..855647e23 100644 --- a/bench/testcomp/testcomp.ml +++ b/bench/testcomp/testcomp.ml @@ -152,7 +152,7 @@ let notify_finished runs = let headers = let headers = Header.init () in Header.add_list headers - [ ("Content-type", "application/json"); ("User-Agent", "Owibot/1.0") ] + [ ("Content-type", "application/json"); ("User-Agent", "Owibot/1.1") ] in let send url body = let body = Cohttp_lwt.Body.of_string (Yojson.to_string body) in @@ -172,9 +172,16 @@ let notify_finished runs = "unknown" in let text = - Format.asprintf "Using tool=*%s* and timeout=*%F*@\n@\n%a@." - (Tool.to_reference_name tool) - timeout Report.Runs.pp_quick_results runs + Format.asprintf + "@[Using:@;\ + - Tool: `%s`@;\ + - Timeout: `%F`@;\ + - Output dir: `%a`@\n\ + @\n\ + Results:@\n\ + @\n\ + %a@." + reference_name timeout Fpath.pp output_dir Report.Runs.pp_table runs in (* Notify on `ZULIP_WEBHOOK` *) match Bos.OS.Env.var "ZULIP_WEBHOOK" with