Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irmin/test: tighten test module conventions (E600/E615)

- Rename test_helpers.ml{,i} to helpers.ml{,i}: it holds test helpers,
not an Alcotest suite, so the test_ prefix mis-signals. Updates
callers in test_atproto{,_ext,_tree}, test_pds_interop, test_stores.
- Add test_*.mli files for test_admin, test_atproto{,_ext,_tree},
test_gzip so every test module advertises only `suite`.
- Collapse test_stores `suites` list to a single `suite` (one generic
store runner per backend) to match the one-suite-per-module convention.
- Wire the previously-missing test suites into test.ml so they actually
run.

+25 -15
+2 -2
test/test.ml
··· 2 2 Alcotest.run "Irmin" 3 3 [ 4 4 Test_admin.suite; 5 + Test_gzip.suite; 5 6 Test_hash.suite; 6 7 Test_heap.suite; 7 - Test_gzip.suite; 8 8 Test_irmin.suite; 9 - Test_schema.suite; 10 9 Test_irmin_tar.suite; 10 + Test_schema.suite; 11 11 Test_sync.suite; 12 12 Test_worktree.suite; 13 13 ]
+2
test/test_admin.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** [suite] is the alcotest test suite for [test_admin]. *)
+1 -1
test/test_atproto.ml
··· 247 247 let name = Fmt.str "repo_%d" (Random.int 1_000_000) in 248 248 let path = Eio.Path.(tmp_dir / name) in 249 249 Fun.protect 250 - ~finally:(fun () -> try Test_helpers.rm_rf path with Eio.Io _ -> ()) 250 + ~finally:(fun () -> try Helpers.rm_rf path with Eio.Io _ -> ()) 251 251 (fun () -> 252 252 Eio.Switch.run @@ fun sw -> 253 253 let did = Atp.Did.of_string_exn test_did in
+2
test/test_atproto.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** [suite] is the alcotest test suite for [test_atproto]. *)
+1 -1
test/test_atproto_ext.ml
··· 8 8 let with_memory f = f (Irmin_atproto.memory ()) 9 9 10 10 let cleanup_path path = 11 - try Test_helpers.rm_rf path with Eio.Io _ | Sys_error _ -> () 11 + try Helpers.rm_rf path with Eio.Io _ | Sys_error _ -> () 12 12 13 13 let with_pds_path ~sw path f = 14 14 Fun.protect
+2
test/test_atproto_ext.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** [suite] is the alcotest test suite for [test_atproto_ext]. *)
+2 -2
test/test_atproto_tree.ml
··· 22 22 let name = Fmt.str "repo_%d" (Random.int 1_000_000) in 23 23 let path = Eio.Path.(tmp_dir / name) in 24 24 Fun.protect 25 - ~finally:(fun () -> try Test_helpers.rm_rf path with Eio.Io _ -> ()) 25 + ~finally:(fun () -> try Helpers.rm_rf path with Eio.Io _ -> ()) 26 26 (fun () -> 27 27 Eio.Switch.run @@ fun sw -> 28 28 let pds = Pds.v ~sw path ~did:test_did in ··· 328 328 let name = Fmt.str "persist_%d" (Random.int 1_000_000) in 329 329 let path = Eio.Path.(tmp_dir / name) in 330 330 Fun.protect 331 - ~finally:(fun () -> try Test_helpers.rm_rf path with Eio.Io _ -> ()) 331 + ~finally:(fun () -> try Helpers.rm_rf path with Eio.Io _ -> ()) 332 332 (fun () -> 333 333 persist_session_write path; 334 334 persist_session_read path)
+2
test/test_atproto_tree.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** [suite] is the alcotest test suite for [test_atproto_tree]. *)
+2
test/test_gzip.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** [suite] is the alcotest test suite for [test_gzip]. *)
test/test_helpers.ml test/helpers.ml
test/test_helpers.mli test/helpers.mli
+5 -5
test/test_pds_interop.ml
··· 17 17 let name = Fmt.str "repo_%d" (Random.int 1_000_000) in 18 18 let path = Eio.Path.(tmp_dir / name) in 19 19 Fun.protect 20 - ~finally:(fun () -> try Test_helpers.rm_rf path with Eio.Io _ -> ()) 20 + ~finally:(fun () -> try Helpers.rm_rf path with Eio.Io _ -> ()) 21 21 (fun () -> f path) 22 22 23 23 (* ---- PDS write → MST read ---- *) ··· 193 193 let path2 = Eio.Path.(tmp_dir / name2) in 194 194 Fun.protect 195 195 ~finally:(fun () -> 196 - (try Test_helpers.rm_rf path1 with Eio.Io _ -> ()); 197 - try Test_helpers.rm_rf path2 with Eio.Io _ -> ()) 196 + (try Helpers.rm_rf path1 with Eio.Io _ -> ()); 197 + try Helpers.rm_rf path2 with Eio.Io _ -> ()) 198 198 (fun () -> 199 199 (* Create source repo with data *) 200 200 let car_data = ··· 225 225 let name = Fmt.str "persist_%d" (Random.int 1_000_000) in 226 226 let path = Eio.Path.(tmp_dir / name) in 227 227 Fun.protect 228 - ~finally:(fun () -> try Test_helpers.rm_rf path with Eio.Io _ -> ()) 228 + ~finally:(fun () -> try Helpers.rm_rf path with Eio.Io _ -> ()) 229 229 (fun () -> 230 230 let data = 231 231 Atp.Dagcbor.encode_string ~cid_format:`Atproto ··· 265 265 let name = Fmt.str "did_%d" (Random.int 1_000_000) in 266 266 let path = Eio.Path.(tmp_dir / name) in 267 267 Fun.protect 268 - ~finally:(fun () -> try Test_helpers.rm_rf path with Eio.Io _ -> ()) 268 + ~finally:(fun () -> try Helpers.rm_rf path with Eio.Io _ -> ()) 269 269 (fun () -> 270 270 let custom_did = Atp.Did.of_string_exn "did:plc:abc123xyz" in 271 271 Eio.Switch.run (fun sw ->
+2 -2
test/test_stores.ml
··· 1 1 (** Backend configs for the generic store test suite. *) 2 2 3 3 let cleanup_path path = 4 - try Test_helpers.rm_rf path with Eio.Io _ | Sys_error _ -> () 4 + try Helpers.rm_rf path with Eio.Io _ | Sys_error _ -> () 5 5 6 6 let run_git f = 7 7 Eio_main.run @@ fun env -> ··· 16 16 let git : Irmin_git.t Generic_store.config = 17 17 Generic_store.make ~name:"git" ~run:run_git 18 18 19 - let suites = [ Generic_store.suite git ] 19 + let suite = Generic_store.suite git
+2 -2
test/test_stores.mli
··· 1 - val suites : (string * unit Alcotest.test_case list) list 2 - (** Generic store test suites for all backend × hash combinations. *) 1 + val suite : string * unit Alcotest.test_case list 2 + (** [suite] is the alcotest test suite covering all generic store backends. *)