• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MinaProtocol / mina / 3391

21 Feb 2025 09:32PM UTC coverage: 30.539% (-12.7%) from 43.251%
3391

push

buildkite

web-flow
Merge pull request #16657 from MinaProtocol/georgeee/proof-cache-id-db

Introduce identity cache db

1 of 1 new or added line in 1 file covered. (100.0%)

16130 existing lines in 343 files now uncovered.

10806 of 35384 relevant lines covered (30.54%)

6862.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

11.11
/src/lib/disk_cache/utils.ml
1
open Core
4✔
2
open Async
3

4
let failed_to_get_cache_folder_status ~logger ~(error_msg : string) ~path =
UNCOV
5
  [%log error] "%s" error_msg ~metadata:[ ("path", `String path) ] ;
×
UNCOV
6
  `Initialization_error (Error.createf "%s (%s)" error_msg path)
×
7

8
(** Initialize a directory at a path:
9
      - if it does not exist, create it
10
      - if it exists, clear it
11
      - if the path provided is a file, fail
12
      - if it is not impossible to retrieve the status of the path, fail
13
*)
14
let initialize_dir path ~logger =
UNCOV
15
  let fail error_msg =
×
UNCOV
16
    Deferred.Result.fail
×
17
      (failed_to_get_cache_folder_status ~logger ~error_msg ~path)
18
  in
UNCOV
19
  match%bind Sys.is_directory path with
×
UNCOV
20
  | `Yes ->
×
UNCOV
21
      let%map () = File_system.clear_dir path in
×
UNCOV
22
      Ok path
×
UNCOV
23
  | `No -> (
×
UNCOV
24
      match%bind Sys.file_exists ~follow_symlinks:false path with
×
UNCOV
25
      | `Yes ->
×
26
          fail "Path to proof cache folder points to a non-directory"
27
      | `No ->
×
28
          let%map () = File_system.create_dir path in
×
29
          Ok path
×
30
      | `Unknown ->
×
31
          fail "Cannot evaluate existence of cache folder" )
UNCOV
32
  | `Unknown ->
×
33
      fail "Cannot evaluate existence of cache folder"
8✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc