Monorepo management for opam overlays
0
fork

Configure Feed

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

monopam tests: shorten long identifier names (E320)

Trim 5–6-underscore test function names down to ≤4 segments. The
alcotest description string keeps the full intent; only the OCaml
identifier shrinks. No test logic changed.

Examples: test_derive_sources_override_branch_from_dune ->
test_derive_override_branch_dune; test_normalize_url_strips_dot_git ->
test_normalize_url_strip_dotgit; test_pp_subtree_info_with_commit ->
test_pp_subtree_with_commit.

+62 -68
+4 -4
test/test_changes.ml
··· 44 44 Alcotest.(check string) "week start" "2026-03-16" ws; 45 45 Alcotest.(check string) "week end" "2026-03-22" we 46 46 47 - let test_week_of_date_cross_month () = 47 + let test_week_cross_month () = 48 48 (* 2026-03-30 is a Monday, week ends April 5 *) 49 49 let ws, we = Changes.week_of_date (2026, 3, 30) in 50 50 Alcotest.(check string) "week start" "2026-03-30" ws; 51 51 Alcotest.(check string) "week end crosses month" "2026-04-05" we 52 52 53 - let test_week_of_date_cross_year () = 53 + let test_week_cross_year () = 54 54 (* 2025-12-31 is a Wednesday *) 55 55 let ws, we = Changes.week_of_date (2025, 12, 31) in 56 56 Alcotest.(check string) "week start" "2025-12-29" ws; ··· 239 239 Alcotest.test_case "week monday" `Quick test_week_of_date_monday; 240 240 Alcotest.test_case "week wednesday" `Quick test_week_of_date_wednesday; 241 241 Alcotest.test_case "week sunday" `Quick test_week_of_date_sunday; 242 - Alcotest.test_case "week cross month" `Quick test_week_of_date_cross_month; 243 - Alcotest.test_case "week cross year" `Quick test_week_of_date_cross_year; 242 + Alcotest.test_case "week cross month" `Quick test_week_cross_month; 243 + Alcotest.test_case "week cross year" `Quick test_week_cross_year; 244 244 Alcotest.test_case "week_of_ptime" `Quick test_week_of_ptime; 245 245 Alcotest.test_case "date_of_ptime" `Quick test_date_of_ptime; 246 246 Alcotest.test_case "week_timestamps" `Quick test_week_timestamps_of_ptime;
+4 -5
test/test_config.ml
··· 25 25 (* Default knot when not specified *) 26 26 Alcotest.(check string) "default knot" "git.recoil.org" (Config.knot config) 27 27 28 - let test_knot_required_in_config_file () = 28 + let test_knot_required_in_config () = 29 29 (* Config file must have [identity] knot = "..." — no guessing *) 30 30 let root = Fpath.v "/home/user/workspace" in 31 31 let config = Config.v ~root ~handle:"localuser" ~knot:"git.myserver.com" () in ··· 136 136 user-visible prefix so that Common.with_config can pattern-match on the 137 137 variant to pick the right hint. *) 138 138 139 - let test_pp_load_error_not_found () = 139 + let test_pp_error_not_found () = 140 140 let err = Config.Not_found (Fpath.v "/tmp/nope.toml") in 141 141 let msg = Fmt.str "%a" Config.pp_load_error err in 142 142 Alcotest.(check bool) ··· 166 166 Alcotest.test_case "with knot" `Quick test_create_with_knot; 167 167 Alcotest.test_case "default knot derivation" `Quick test_default_knot; 168 168 Alcotest.test_case "knot required in config" `Quick 169 - test_knot_required_in_config_file; 169 + test_knot_required_in_config; 170 170 Alcotest.test_case "default paths" `Quick test_default_paths; 171 171 Alcotest.test_case "derived paths" `Quick test_derived_paths; 172 172 Alcotest.test_case "custom paths" `Quick test_custom_paths; ··· 175 175 Alcotest.test_case "with override" `Quick test_with_package_override; 176 176 Alcotest.test_case "update override" `Quick test_override_update; 177 177 Alcotest.test_case "default branch" `Quick test_default_branch; 178 - Alcotest.test_case "load_error: not found" `Quick 179 - test_pp_load_error_not_found; 178 + Alcotest.test_case "load_error: not found" `Quick test_pp_error_not_found; 180 179 Alcotest.test_case "load_error: invalid" `Quick test_pp_load_error_invalid; 181 180 Alcotest.test_case "load_error: io" `Quick test_pp_load_error_io; 182 181 ] )
+4 -5
test/test_cross_status.ml
··· 55 55 56 56 (* {1 pp_subtree_info tests} *) 57 57 58 - let test_pp_subtree_info_with_commit () = 58 + let test_pp_subtree_with_commit () = 59 59 let info : CS.subtree_info = 60 60 { 61 61 monorepo_path = Fpath.v "/tmp/mono"; ··· 66 66 let s = Fmt.str "%a" CS.pp_subtree_info info in 67 67 Alcotest.(check string) "short hash" "abcdef1" s 68 68 69 - let test_pp_subtree_info_no_commit () = 69 + let test_pp_subtree_no_commit () = 70 70 let info : CS.subtree_info = 71 71 { 72 72 monorepo_path = Fpath.v "/tmp/mono"; ··· 105 105 Alcotest.test_case "not actionable unknown" `Quick 106 106 test_not_actionable_unknown; 107 107 Alcotest.test_case "subtree with commit" `Quick 108 - test_pp_subtree_info_with_commit; 109 - Alcotest.test_case "subtree no commit" `Quick 110 - test_pp_subtree_info_no_commit; 108 + test_pp_subtree_with_commit; 109 + Alcotest.test_case "subtree no commit" `Quick test_pp_subtree_no_commit; 111 110 Alcotest.test_case "pp empty" `Quick test_pp_empty; 112 111 Alcotest.test_case "pp_summary empty" `Quick test_pp_summary_empty; 113 112 ] )
+2 -2
test/test_ctx.ml
··· 90 90 Alcotest.(check string) 91 91 "ssh passthrough" "git@github.com:user/repo.git" result 92 92 93 - let test_push_url_strips_git_plus () = 93 + let test_push_url_strip_gitplus () = 94 94 let result = Ctx.url_to_push_url "git+https://github.com/user/repo.git" in 95 95 Alcotest.(check string) "strips git+" "git@github.com:user/repo.git" result 96 96 ··· 186 186 Alcotest.test_case "push gitlab" `Quick test_push_url_gitlab; 187 187 Alcotest.test_case "push ssh passthrough" `Quick 188 188 test_push_url_ssh_passthrough; 189 - Alcotest.test_case "push strips git+" `Quick test_push_url_strips_git_plus; 189 + Alcotest.test_case "push strips git+" `Quick test_push_url_strip_gitplus; 190 190 (* exit_code *) 191 191 Alcotest.test_case "exit user error" `Quick test_exit_user_error; 192 192 Alcotest.test_case "exit git user error" `Quick test_exit_git_user_error;
+2 -2
test/test_diff.ml
··· 36 36 let s = Fmt.str "%a" Diff.pp_handle_pull_result r in 37 37 ignore s 38 38 39 - let test_pp_handle_pull_with_data () = 39 + let test_pp_pull_with_data () = 40 40 let r : Diff.handle_pull_result = 41 41 { 42 42 repos_pulled = [ ("eio", 3); ("dune", 1) ]; ··· 71 71 Alcotest.test_case "sha not hex" `Quick test_sha_not_hex; 72 72 Alcotest.test_case "sha with spaces" `Quick test_sha_with_spaces; 73 73 Alcotest.test_case "pp pull empty" `Quick test_pp_handle_pull_empty; 74 - Alcotest.test_case "pp pull data" `Quick test_pp_handle_pull_with_data; 74 + Alcotest.test_case "pp pull data" `Quick test_pp_pull_with_data; 75 75 Alcotest.test_case "pp cherrypick" `Quick test_pp_cherrypick; 76 76 ] )
+2 -2
test/test_dune_project.ml
··· 168 168 in 169 169 check_ok "uri dev-repo" "git+https://example.com/foo.git" (DP.dev_repo_url t) 170 170 171 - let test_dev_repo_uri_already_git () = 171 + let test_dev_repo_uri_git () = 172 172 let t : DP.t = 173 173 { 174 174 name = "foo"; ··· 257 257 Alcotest.test_case "dev_repo tangled" `Quick test_dev_repo_tangled; 258 258 Alcotest.test_case "dev_repo uri" `Quick test_dev_repo_uri; 259 259 Alcotest.test_case "dev_repo uri no double .git" `Quick 260 - test_dev_repo_uri_already_git; 260 + test_dev_repo_uri_git; 261 261 Alcotest.test_case "dev_repo homepage fallback" `Quick 262 262 test_dev_repo_homepage_fallback; 263 263 Alcotest.test_case "dev_repo no source" `Quick test_dev_repo_no_source;
+2 -3
test/test_feature.ml
··· 32 32 in 33 33 Alcotest.(check bool) "has hint" true (String.length s > 0) 34 34 35 - let test_pp_with_hint_not_found () = 35 + let test_pp_hint_not_found () = 36 36 let s = 37 37 Fmt.str "%a" Feature.pp_error_with_hint 38 38 (Feature.Feature_not_found "my-feature") ··· 60 60 Alcotest.test_case "pp not found" `Quick test_pp_feature_not_found; 61 61 Alcotest.test_case "pp config error" `Quick test_pp_config_error; 62 62 Alcotest.test_case "pp with hint exists" `Quick test_pp_with_hint_exists; 63 - Alcotest.test_case "pp with hint not found" `Quick 64 - test_pp_with_hint_not_found; 63 + Alcotest.test_case "pp with hint not found" `Quick test_pp_hint_not_found; 65 64 Alcotest.test_case "pp entry" `Quick test_pp_entry; 66 65 ] )
+8 -9
test/test_forks.ml
··· 70 70 71 71 (* {1 URL utility tests} *) 72 72 73 - let test_normalize_url_strips_git_plus () = 73 + let test_normalize_url_strip_gitplus () = 74 74 let url = 75 75 Forks.normalize_url (Uri.of_string "git+https://github.com/user/repo.git") 76 76 in ··· 79 79 "no git+ prefix" true 80 80 (not (String.starts_with ~prefix:"git+" s)) 81 81 82 - let test_normalize_url_strips_dot_git () = 82 + let test_normalize_url_strip_dotgit () = 83 83 let url = 84 84 Forks.normalize_url (Uri.of_string "https://github.com/user/repo.git") 85 85 in ··· 93 93 let u2 = Uri.of_string "https://github.com/user/repo.git" in 94 94 Alcotest.(check bool) "same URL" true (Forks.urls_equal u1 u2) 95 95 96 - let test_urls_equal_with_without_dot_git () = 96 + let test_urls_equal_dotgit_optional () = 97 97 let u1 = Uri.of_string "https://github.com/user/repo.git" in 98 98 let u2 = Uri.of_string "https://github.com/user/repo" in 99 99 Alcotest.(check bool) ".git vs no .git" true (Forks.urls_equal u1 u2) ··· 114 114 in 115 115 Alcotest.(check string) "basename" "eio" name 116 116 117 - let test_repo_basename_no_git_suffix () = 117 + let test_repo_basename_no_git () = 118 118 let name = 119 119 Forks.repo_basename (Uri.of_string "https://github.com/user/eio") 120 120 in ··· 157 157 test_not_actionable_not_fetched; 158 158 (* URL utilities *) 159 159 Alcotest.test_case "normalize strips git+" `Quick 160 - test_normalize_url_strips_git_plus; 160 + test_normalize_url_strip_gitplus; 161 161 Alcotest.test_case "normalize strips .git" `Quick 162 - test_normalize_url_strips_dot_git; 162 + test_normalize_url_strip_dotgit; 163 163 Alcotest.test_case "urls equal same" `Quick test_urls_equal_same; 164 164 Alcotest.test_case "urls equal .git" `Quick 165 - test_urls_equal_with_without_dot_git; 165 + test_urls_equal_dotgit_optional; 166 166 Alcotest.test_case "urls equal git+" `Quick test_urls_equal_git_plus; 167 167 Alcotest.test_case "urls not equal" `Quick test_urls_not_equal; 168 168 Alcotest.test_case "basename .git" `Quick test_repo_basename_simple; 169 - Alcotest.test_case "basename no .git" `Quick 170 - test_repo_basename_no_git_suffix; 169 + Alcotest.test_case "basename no .git" `Quick test_repo_basename_no_git; 171 170 (* pp *) 172 171 Alcotest.test_case "pp empty" `Quick test_pp_empty; 173 172 Alcotest.test_case "pp summary empty" `Quick test_pp_summary_empty;
+12 -14
test/test_import.ml
··· 67 67 "https is url" true 68 68 (Import.looks_like_url "https://github.com/owner/repo.git") 69 69 70 - let test_looks_like_url_git_at () = 70 + let test_looks_like_url_at () = 71 71 Alcotest.(check bool) 72 72 "git@ is url" true 73 73 (Import.looks_like_url "git@github.com:owner/repo.git") 74 74 75 - let test_looks_like_url_git_plus () = 75 + let test_looks_like_url_plus () = 76 76 Alcotest.(check bool) 77 77 "git+ is url" true 78 78 (Import.looks_like_url "git+https://example.com/repo") 79 79 80 - let test_looks_like_url_local_path () = 80 + let test_looks_like_url_local () = 81 81 Alcotest.(check bool) 82 82 "local path is url" true 83 83 (Import.looks_like_url "./local/repo") 84 84 85 - let test_looks_like_url_dot_git () = 85 + let test_looks_like_url_dotgit () = 86 86 Alcotest.(check bool) 87 87 "trailing .git is url" true 88 88 (Import.looks_like_url "myrepo.git") 89 89 90 - let test_looks_like_url_bare_name () = 90 + let test_looks_like_url_bare () = 91 91 (* Opam package name — NOT a URL *) 92 92 Alcotest.(check bool) 93 93 "plain name is not url" false 94 94 (Import.looks_like_url "crowbar") 95 95 96 - let test_looks_like_url_hyphen_name () = 96 + let test_looks_like_url_hyphen () = 97 97 Alcotest.(check bool) 98 98 "hyphenated name is not url" false 99 99 (Import.looks_like_url "opam-file-format") ··· 117 117 Alcotest.test_case "timestamp format" `Quick test_timestamp_format; 118 118 (* looks_like_url *) 119 119 Alcotest.test_case "looks_like_url https" `Quick test_looks_like_url_https; 120 - Alcotest.test_case "looks_like_url git@" `Quick test_looks_like_url_git_at; 121 - Alcotest.test_case "looks_like_url git+" `Quick 122 - test_looks_like_url_git_plus; 120 + Alcotest.test_case "looks_like_url git@" `Quick test_looks_like_url_at; 121 + Alcotest.test_case "looks_like_url git+" `Quick test_looks_like_url_plus; 123 122 Alcotest.test_case "looks_like_url local path" `Quick 124 - test_looks_like_url_local_path; 125 - Alcotest.test_case "looks_like_url .git" `Quick 126 - test_looks_like_url_dot_git; 123 + test_looks_like_url_local; 124 + Alcotest.test_case "looks_like_url .git" `Quick test_looks_like_url_dotgit; 127 125 Alcotest.test_case "looks_like_url plain name" `Quick 128 - test_looks_like_url_bare_name; 126 + test_looks_like_url_bare; 129 127 Alcotest.test_case "looks_like_url hyphen name" `Quick 130 - test_looks_like_url_hyphen_name; 128 + test_looks_like_url_hyphen; 131 129 ] )
+2 -2
test/test_package.ml
··· 146 146 147 147 (* Test that for multi-opam repos, matches_name finds the main package 148 148 so log_missing_repos picks the right synopsis. *) 149 - let test_best_synopsis_for_multi_opam_repo () = 149 + let test_best_synopsis_multi_opam () = 150 150 let dev_repo = 151 151 Uri.of_string "https://tangled.org/gazagnaire.org/ocaml-scitt" 152 152 in ··· 208 208 Alcotest.test_case "by repo name" `Quick test_matches_name_by_repo; 209 209 Alcotest.test_case "no match" `Quick test_matches_name_no_match; 210 210 Alcotest.test_case "multi-opam synopsis" `Quick 211 - test_best_synopsis_for_multi_opam_repo; 211 + test_best_synopsis_multi_opam; 212 212 ] )
+20 -20
test/test_pkg.ml
··· 57 57 "git+https://tangled.org/gazagnaire.org/memtrace" )) 58 58 (Pkg.derive_dev_repo ~sources ~subtree:"memtrace" dp) 59 59 60 - let test_derive_sources_override_with_branch () = 60 + let test_derive_override_with_branch () = 61 61 (* With origin set, HTTPS URL + main branch (monopam push target) *) 62 62 let sources = 63 63 SR.with_origin SR.empty "git+https://tangled.org/gazagnaire.org" |> fun s -> ··· 72 72 "git+https://tangled.org/gazagnaire.org/memtrace" )) 73 73 (Pkg.derive_dev_repo ~sources ~subtree:"memtrace" dp) 74 74 75 - let test_derive_sources_override_no_origin () = 75 + let test_derive_override_no_origin () = 76 76 (* Without origin, the entry SSH source and branch are used *) 77 77 let sources = 78 78 SR.add SR.empty ~subtree:"memtrace" ··· 86 86 "git@git.recoil.org:gazagnaire.org/memtrace#master" )) 87 87 (Pkg.derive_dev_repo ~sources ~subtree:"memtrace" dp) 88 88 89 - let test_derive_sources_override_branch_from_dune () = 89 + let test_derive_override_branch_dune () = 90 90 let sources = 91 91 SR.add SR.empty ~subtree:"foo" (sr_entry "git+https://example.com/foo") 92 92 in ··· 99 99 (Some ("git+https://example.com/foo", "git+https://example.com/foo#develop")) 100 100 (Pkg.derive_dev_repo ~sources ~subtree:"foo" dp) 101 101 102 - let test_derive_sources_override_no_branch () = 102 + let test_derive_override_no_branch () = 103 103 let sources = 104 104 SR.add SR.empty ~subtree:"foo" (sr_entry "git+https://example.com/foo") 105 105 in ··· 150 150 "git+https://example.com/repo.git#dev" )) 151 151 (Pkg.derive_dev_repo ~sources:SR.empty ~subtree:"repo" dp) 152 152 153 - let test_derive_from_uri_no_branch () = 153 + let test_derive_uri_no_branch () = 154 154 let dp = 155 155 dune_proj 156 156 ~source:(Uri { url = "https://example.com/repo"; branch = None }) ··· 173 173 "git+https://tangled.org/user/test-subtree#main" )) 174 174 (Pkg.derive_dev_repo ~sources ~subtree:"test-subtree" dp) 175 175 176 - let test_derive_from_origin_trailing_slash () = 176 + let test_derive_origin_trailing () = 177 177 let sources = SR.with_origin SR.empty "git+https://tangled.org/user/" in 178 178 let dp = dune_proj () in 179 179 check_dev_repo "origin trailing slash stripped" ··· 191 191 192 192 (* {1 derive_dev_repo: priority ordering} *) 193 193 194 - let test_derive_sources_wins_over_dune () = 194 + let test_derive_sources_wins_dune () = 195 195 (* With origin, HTTPS URL from origin is used even when dune-project has github *) 196 196 let sources = 197 197 SR.with_origin SR.empty "git+https://tangled.org/user" |> fun s -> ··· 203 203 ("git+https://tangled.org/user/pkg", "git+https://tangled.org/user/pkg")) 204 204 (Pkg.derive_dev_repo ~sources ~subtree:"pkg" dp) 205 205 206 - let test_derive_dune_wins_over_origin () = 206 + let test_derive_dune_wins_origin () = 207 207 let sources = SR.with_origin SR.empty "git+https://tangled.org/user" in 208 208 let dp = dune_proj ~source:(Github { user = "ocaml"; repo = "eio" }) () in 209 209 check_dev_repo "dune-project wins over origin" ··· 212 212 "git+https://github.com/ocaml/eio.git#main" )) 213 213 (Pkg.derive_dev_repo ~sources ~subtree:"eio" dp) 214 214 215 - let test_derive_sources_wins_over_origin () = 215 + let test_derive_sources_wins_origin () = 216 216 (* When both entry and origin exist, origin HTTPS URL is used for opam *) 217 217 let sources = 218 218 SR.with_origin SR.empty "git+https://tangled.org/user" |> fun s -> ··· 246 246 "git+https://tangled.org/gazagnaire.org/memtrace" )) 247 247 (Pkg.derive_dev_repo ~sources ~subtree:"memtrace" dp) 248 248 249 - let test_derive_no_entry_uses_dune_project () = 249 + let test_derive_unrelated_entry () = 250 250 (* Package not in sources.toml, but has dune-project source *) 251 251 let sources = 252 252 SR.add SR.empty ~subtree:"other" (sr_entry "git+https://example.com/other") ··· 271 271 Alcotest.test_case "derive: sources.toml override" `Quick 272 272 test_derive_sources_override; 273 273 Alcotest.test_case "derive: sources.toml with branch" `Quick 274 - test_derive_sources_override_with_branch; 274 + test_derive_override_with_branch; 275 275 Alcotest.test_case "derive: sources.toml no origin" `Quick 276 - test_derive_sources_override_no_origin; 276 + test_derive_override_no_origin; 277 277 Alcotest.test_case "derive: sources.toml branch from dune" `Quick 278 - test_derive_sources_override_branch_from_dune; 278 + test_derive_override_branch_dune; 279 279 Alcotest.test_case "derive: sources.toml no branch" `Quick 280 - test_derive_sources_override_no_branch; 280 + test_derive_override_no_branch; 281 281 (* derive_dev_repo: dune-project fallback *) 282 282 Alcotest.test_case "derive: github" `Quick test_derive_from_github; 283 283 Alcotest.test_case "derive: gitlab" `Quick test_derive_from_gitlab; 284 284 Alcotest.test_case "derive: tangled" `Quick test_derive_from_tangled; 285 285 Alcotest.test_case "derive: uri with branch" `Quick test_derive_from_uri; 286 286 Alcotest.test_case "derive: uri no branch" `Quick 287 - test_derive_from_uri_no_branch; 287 + test_derive_uri_no_branch; 288 288 (* derive_dev_repo: origin fallback *) 289 289 Alcotest.test_case "derive: origin" `Quick test_derive_from_origin; 290 290 Alcotest.test_case "derive: origin trailing slash" `Quick 291 - test_derive_from_origin_trailing_slash; 291 + test_derive_origin_trailing; 292 292 (* derive_dev_repo: no source *) 293 293 Alcotest.test_case "derive: none" `Quick test_derive_none; 294 294 (* derive_dev_repo: priority *) 295 295 Alcotest.test_case "derive: sources wins over dune" `Quick 296 - test_derive_sources_wins_over_dune; 296 + test_derive_sources_wins_dune; 297 297 Alcotest.test_case "derive: dune wins over origin" `Quick 298 - test_derive_dune_wins_over_origin; 298 + test_derive_dune_wins_origin; 299 299 Alcotest.test_case "derive: sources wins over origin" `Quick 300 - test_derive_sources_wins_over_origin; 300 + test_derive_sources_wins_origin; 301 301 (* derive_dev_repo: real-world *) 302 302 Alcotest.test_case "derive: memtrace scenario" `Quick 303 303 test_derive_memtrace_scenario; 304 304 Alcotest.test_case "derive: unrelated entry" `Quick 305 - test_derive_no_entry_uses_dune_project; 305 + test_derive_unrelated_entry; 306 306 ] )