From fa95cc5e556e9862a08b282009d3f5649acab260 Mon Sep 17 00:00:00 2001 From: Kate Date: Wed, 11 Dec 2024 16:07:44 +0000 Subject: [PATCH] Extend the tests on opam admin check by including all the arguments Co-authored-by: Raja Boujbel --- master_changes.md | 1 + tests/reftests/admin.test | 82 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/master_changes.md b/master_changes.md index 2e687c5f01d..aa6465ddabf 100644 --- a/master_changes.md +++ b/master_changes.md @@ -104,6 +104,7 @@ users) ## Reftests ### Tests * Extend the tests on opam admin to include packages using builtin global variables [#6331 @kit-ty-kate] + * Extend the tests on opam admin check by including all the arguments [#6331 @kit-ty-kate @rjbou] ### Engine diff --git a/tests/reftests/admin.test b/tests/reftests/admin.test index 7bfdf87aa99..d2ec891563d 100644 --- a/tests/reftests/admin.test +++ b/tests/reftests/admin.test @@ -321,14 +321,94 @@ vars -- A word ### ::::::::::::: ### :III: check : ### ::::::::::::: +### +opam-version: "2.0" +depends: [ + "lorem" { = "1.0" & with-test } # for obsolete -i test + "not-found" { with-test } # for installability -i test +] +### +opam-version: "2.0" +depends: [ + "tortor" # for cycle test + "dignissim" {with-doc} # for cycle -i test +] +### +opam-version: "2.0" +depends: "lectus" +### +opam-version: "2.0" +depends: "lectus" +### # by default, the check does installability & cycle check ### opam admin check Checking installability of every package. This may take a few minutes... +[ERROR] These packages are not installable (3): + ocaml-system.1.2 risus.1 suspendisse.1 +[ERROR] Dependency cycles detected: + * lectus = 1 -> dignissim = 1 + * lectus = 1 -> tortor = 1 +Summary: out of 25 packages (22 distinct names) +- 3 uninstallable roots +- 3 packages part of dependency cycles + +# Return code 1 # +### opam admin check -i +Checking installability of every package. This may take a few minutes... +[ERROR] These packages are not installable (2): + ocaml-system.1.2 risus.1 +[ERROR] Dependency cycles detected: + * lectus = 1 -> tortor = 1 +Summary: out of 25 packages (22 distinct names) +- 2 uninstallable roots +- 2 packages part of dependency cycles + +# Return code 1 # +### opam admin check --installability +Checking installability of every package. This may take a few minutes... +[ERROR] These packages are not installable (3): + ocaml-system.1.2 risus.1 suspendisse.1 +Summary: out of 25 packages (22 distinct names) +- 3 uninstallable roots + +# Return code 1 # +### opam admin check --installability -i +Checking installability of every package. This may take a few minutes... [ERROR] These packages are not installable (2): ocaml-system.1.2 risus.1 -Summary: out of 21 packages (18 distinct names) +Summary: out of 25 packages (22 distinct names) - 2 uninstallable roots # Return code 1 # +### opam admin check --obsolete +[ERROR] Obsolete packages detected: + - lorem 2.0 +Summary: out of 25 packages (22 distinct names) +- 1 obsolete packages + +# Return code 1 # +### opam admin check --obsolete -i +[ERROR] Obsolete packages detected: + - lorem 1.0, 2.0 +Summary: out of 25 packages (22 distinct names) +- 2 obsolete packages + +# Return code 1 # +### opam admin check --cycles +[ERROR] Dependency cycles detected: + * lectus = 1 -> dignissim = 1 + * lectus = 1 -> tortor = 1 +Summary: out of 25 packages (22 distinct names) +- 3 packages part of dependency cycles + +# Return code 1 # +### opam admin check --cycles -i +[ERROR] Dependency cycles detected: + * lectus = 1 -> tortor = 1 +Summary: out of 25 packages (22 distinct names) +- 2 packages part of dependency cycles + +# Return code 1 # +### rm -r packages/suspendisse packages/lectus packages/tortor packages/dignissim ### : index : ### opam admin index Generating urls.txt...