Skip to content

Commit

Permalink
Add tests showing behaviour of opam pin when confronted with a missin…
Browse files Browse the repository at this point in the history
…g opam description
  • Loading branch information
kit-ty-kate committed Nov 30, 2024
1 parent eec1cc4 commit 1445912
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions tests/reftests/pin.test
Original file line number Diff line number Diff line change
Expand Up @@ -937,3 +937,105 @@ vcs-local is now pinned to git+file://${BASEDIR}/vcs-local#master (version dev)
### opam show vcs-local --field build:,url.src:
build: "false"
url.src: "git+file://${BASEDIR}/vcs-local#master"
### : behaviour of opam pin when confronted with a missing opam description
### OPAMEDITOR="echo iNvAlId "
### <pin:missing-opam/pkg.opam>
opam-version: "2.0"
### opam pin pkg-with-typo ./missing-opam --no-action
Package pkg-with-typo does not exist, create as a NEW package? [Y/n] y
[pkg-with-typo.dev] synchronised (file://${BASEDIR}/missing-opam)
[NOTE] No package definition found for pkg-with-typo.dev: please complete the template
iNvAlId ${BASEDIR}/OPAM/vcs-local/.opam-switch/overlay/pkg-with-typo/opam_
[WARNING] The opam file didn't pass validation:
error 22: Some fields are present but empty; remove or fill them: "homepage", "license", "bug_reports"
error 57: Synopsis must not be empty
warning 62: License doesn't adhere to the SPDX standard, see https://spdx.org/licenses/ : ""
Proceed anyway ('no' will re-edit)? [Y/n] y
You can edit this file again with "opam pin edit pkg-with-typo", export it with "opam show pkg-with-typo --raw"
pkg-with-typo is now pinned to file://${BASEDIR}/missing-opam (version dev)
### opam pin pkg-with-typo ./missing-opam
[NOTE] Package pkg-with-typo is already pinned to file://${BASEDIR}/missing-opam (version dev).
[pkg-with-typo.dev] synchronised (no changes)
pkg-with-typo is now pinned to file://${BASEDIR}/missing-opam (version dev)

[ERROR] Package conflict!
* Missing dependency:
- pkg-with-typo -> specify-dependencies-here
unknown package

[NOTE] Pinning command successful, but your installed packages may be out of sync.
# Return code 20 #
### <pin:missing-opam/pkg.opam>
opam-version: "2.0"
pin-depends: [
["pin-pkg.dev" "file://."]
]
### opam pin ./missing-opam
Package pkg does not exist, create as a NEW package? [Y/n] y
The following additional pinnings are required by pkg.dev:
- pin-pkg.dev at file://.
Pin and install them? [Y/n] y
Package pin-pkg does not exist, create as a NEW package? [Y/n] y
[pin-pkg.dev] synchronised (file://.)
[NOTE] No package definition found for pin-pkg.dev: please complete the template
iNvAlId ${BASEDIR}/OPAM/vcs-local/.opam-switch/overlay/pin-pkg/opam_
[WARNING] The opam file didn't pass validation:
error 22: Some fields are present but empty; remove or fill them: "homepage", "license", "bug_reports"
error 57: Synopsis must not be empty
warning 62: License doesn't adhere to the SPDX standard, see https://spdx.org/licenses/ : ""
error 65: URLs must be absolute: "."
Proceed anyway ('no' will re-edit)? [Y/n] y
You can edit this file again with "opam pin edit pin-pkg", export it with "opam show pin-pkg --raw"
pin-pkg is now pinned to file://. (version dev)
pkg is now pinned to file://${BASEDIR}/missing-opam (version dev)

[ERROR] Package conflict!
* Missing dependency:
- pin-pkg -> specify-dependencies-here
unknown package

[NOTE] Pinning command successful, but your installed packages may be out of sync.
# Return code 20 #
### <pin:missing-opam/pkg.opam>
opam-version: "2.0"
depends: [
"pin-pkg"
]
pin-depends: [
["pin-pkg.dev" "file://."]
]
### opam pin ./missing-opam
[NOTE] Package pkg is already pinned to file://${BASEDIR}/missing-opam (version dev).
pkg is now pinned to file://${BASEDIR}/missing-opam (version dev)

[ERROR] Package conflict!
* Missing dependency:
- pkg -> pin-pkg -> specify-dependencies-here
unknown package

[NOTE] Pinning command successful, but your installed packages may be out of sync.
# Return code 20 #
### : special case where the name of the pin-depend matches the name of the package itself (recursive)
### <pin:missing-opam/pkg.opam>
opam-version: "2.0"
pin-depends: [
["pkg.dev" "git+https://github.com/kit-ty-kate/tsv-tools"]
]
### opam pin ./missing-opam
[NOTE] Package pkg is already pinned to file://${BASEDIR}/missing-opam (version dev).
The following additional pinnings are required by pkg.dev:
- pkg.dev at git+https://github.com/kit-ty-kate/tsv-tools
Pin and install them? [Y/n] y
[NOTE] Package pkg is currently pinned to file://${BASEDIR}/missing-opam (version dev).
[pkg.dev] synchronised (git+https://github.com/kit-ty-kate/tsv-tools)
pkg is now pinned to git+https://github.com/kit-ty-kate/tsv-tools (version dev)
pkg is now pinned to file://${BASEDIR}/missing-opam (version dev)

The following actions will be performed:
=== install 1 package
- install pkg dev (pinned)

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved pkg.dev (file://${BASEDIR}/missing-opam)
-> installed pkg.dev
Done.

0 comments on commit 1445912

Please sign in to comment.