Skip to content

Commit fcce0c8

Browse files
authored
Merge pull request #6412 from rjbou/lock-test-no-editor
reftest: untie lock test from OPAMEDITOR hack, and fix lock VCS remote detection
2 parents 3d7af5e + c0f370f commit fcce0c8

File tree

2 files changed

+44
-22
lines changed

2 files changed

+44
-22
lines changed

master_changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ users)
185185
* Add a test to ensure `opam upgrade <pkg>` will not upgrade unrelated things [#6373 @kit-ty-kate]
186186
* Add a test in init to show ocaml system compiler selection behaviour [#6307 @kit-ty-kate @rjbou]
187187
* Add a test showing simulated pinning does not propagate version information [#6256 @rjbou]
188+
* Untie lock with pin depend test from OPAMEDITOR behaviour [#6412 @rjbou]
188189

189190
### Engine
190191

tests/reftests/lock.test

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,39 +1247,60 @@ depends: [
12471247
"a-doc-dep" {with-doc}
12481248
]
12491249
build: [ "test" "-f" "content" ]
1250+
### <add-pindepends.sh>
1251+
basedir=$(printf '%s' "$BASEDIR" | sed 's/\\/\\\\/g')
1252+
cat >> tolock/tolock.opam << EOF
12501253
pin-depends: [
1251-
[ "a-simple-dep.dev" "git+https://github.com/dbuenzli/cmdliner#f239981642a" ]
1252-
[ "a-test-dep.dev" "git+https://github.com/dbuenzli/cmdliner#1de361182ab" ]
1253-
[ "a-doc-dep.dev" "git+https://github.com/dbuenzli/cmdliner#e8f8890fe48" ]
1254+
[ "a-simple-dep.dev" "git+file://$basedir/simple-dep" ]
1255+
[ "a-test-dep.dev" "git+file://$basedir/test-dep" ]
1256+
[ "a-doc-dep.dev" "git+file://$basedir/doc-dep" ]
12541257
]
1258+
EOF
1259+
### sh add-pindepends.sh
12551260
### <tolock/content>
12561261
it's here
1257-
### <pin:opam-file>
1262+
### : -- :
1263+
### mkdir simple-dep
1264+
### git -C simple-dep init -q --initial-branch=master
1265+
### git -C simple-dep config core.autocrlf false
1266+
### <pin:simple-dep/a-simple-dep.opam>
12581267
opam-version: "2.0"
12591268
version: "dev"
1260-
### OPAMEDITOR="cp -f ${BASEDIR}/opam-file"
1269+
### git -C simple-dep add a-simple-dep.opam
1270+
### git -C simple-dep commit -qm "simple"
1271+
### mkdir doc-dep
1272+
### git -C doc-dep init -q --initial-branch=master
1273+
### git -C doc-dep config core.autocrlf false
1274+
### <pin:doc-dep/a-doc-dep.opam>
1275+
opam-version: "2.0"
1276+
version: "dev"
1277+
### git -C doc-dep add a-doc-dep.opam
1278+
### git -C doc-dep commit -qm "doc"
1279+
### mkdir test-dep
1280+
### git -C test-dep init -q --initial-branch=master
1281+
### git -C test-dep config core.autocrlf false
1282+
### <pin:test-dep/a-test-dep.opam>
1283+
opam-version: "2.0"
1284+
version: "dev"
1285+
### git -C test-dep add a-test-dep.opam
1286+
### git -C test-dep commit -qm "test"
1287+
### : -- :
12611288
### opam install ./tolock --with-test --with-doc
12621289
[NOTE] Package tolock does not exist in opam repositories registered in the current switch.
12631290
The following additional pinnings are required by tolock.dev:
1264-
- a-simple-dep.dev at git+https://github.com/dbuenzli/cmdliner#f239981642a
1265-
- a-test-dep.dev at git+https://github.com/dbuenzli/cmdliner#1de361182ab
1266-
- a-doc-dep.dev at git+https://github.com/dbuenzli/cmdliner#e8f8890fe48
1291+
- a-simple-dep.dev at git+file://${BASEDIR}/simple-dep
1292+
- a-test-dep.dev at git+file://${BASEDIR}/test-dep
1293+
- a-doc-dep.dev at git+file://${BASEDIR}/doc-dep
12671294
Pin and install them? [Y/n] y
12681295
[NOTE] Package a-simple-dep does not exist in opam repositories registered in the current switch.
12691296
[a-simple-dep.dev] synchronised (no changes)
1270-
[NOTE] No package definition found for a-simple-dep.dev: please complete the template
1271-
You can edit this file again with "opam pin edit a-simple-dep", export it with "opam show a-simple-dep --raw"
1272-
a-simple-dep is now pinned to git+https://github.com/dbuenzli/cmdliner#f239981642a (version dev)
1297+
a-simple-dep is now pinned to git+file://${BASEDIR}/simple-dep (version dev)
12731298
[NOTE] Package a-test-dep does not exist in opam repositories registered in the current switch.
12741299
[a-test-dep.dev] synchronised (no changes)
1275-
[NOTE] No package definition found for a-test-dep.dev: please complete the template
1276-
You can edit this file again with "opam pin edit a-test-dep", export it with "opam show a-test-dep --raw"
1277-
a-test-dep is now pinned to git+https://github.com/dbuenzli/cmdliner#1de361182ab (version dev)
1300+
a-test-dep is now pinned to git+file://${BASEDIR}/test-dep (version dev)
12781301
[NOTE] Package a-doc-dep does not exist in opam repositories registered in the current switch.
12791302
[a-doc-dep.dev] synchronised (no changes)
1280-
[NOTE] No package definition found for a-doc-dep.dev: please complete the template
1281-
You can edit this file again with "opam pin edit a-doc-dep", export it with "opam show a-doc-dep --raw"
1282-
a-doc-dep is now pinned to git+https://github.com/dbuenzli/cmdliner#e8f8890fe48 (version dev)
1303+
a-doc-dep is now pinned to git+file://${BASEDIR}/doc-dep (version dev)
12831304
tolock is now pinned to file://${BASEDIR}/tolock (version dev)
12841305
The following actions will be performed:
12851306
=== install 5 packages
@@ -1290,17 +1311,17 @@ The following actions will be performed:
12901311
- install tolock dev (pinned)
12911312

12921313
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
1293-
-> retrieved a-doc-dep.dev (no changes)
12941314
-> installed a-doc-dep.dev
1295-
-> retrieved a-simple-dep.dev (no changes)
12961315
-> installed a-simple-dep.dev
1297-
-> retrieved a-test-dep.dev (no changes)
12981316
-> installed a-test-dep.dev
12991317
-> installed foo.2
13001318
-> retrieved tolock.dev (file://${BASEDIR}/tolock)
13011319
-> installed tolock.dev
13021320
Done.
1303-
### opam lock tolock
1321+
### opam lock tolock --keep-local
1322+
[NOTE] Dependency a-doc-dep.dev is pinned to local target git+file://${BASEDIR}/doc-dep, keeping it.
1323+
[NOTE] Dependency a-simple-dep.dev is pinned to local target git+file://${BASEDIR}/simple-dep, keeping it.
1324+
[NOTE] Dependency a-test-dep.dev is pinned to local target git+file://${BASEDIR}/test-dep, keeping it.
13041325
Generated lock files for:
13051326
- tolock.dev: ${BASEDIR}/tolock.opam.locked
13061327
### opam-cat tolock.opam.locked
@@ -1315,7 +1336,7 @@ license: "MIT"
13151336
maintainer: "[email protected]"
13161337
name: "tolock"
13171338
opam-version: "2.0"
1318-
pin-depends: [["a-doc-dep.dev" "git+https://github.com/dbuenzli/cmdliner#e8f8890fe48"] ["a-simple-dep.dev" "git+https://github.com/dbuenzli/cmdliner#f239981642a"] ["a-test-dep.dev" "git+https://github.com/dbuenzli/cmdliner#1de361182ab"]]
1339+
pin-depends: [["a-doc-dep.dev" "git+file://${BASEDIR}/doc-dep"] ["a-simple-dep.dev" "git+file://${BASEDIR}/simple-dep"] ["a-test-dep.dev" "git+file://${BASEDIR}/test-dep"]]
13191340
synopsis: "A word"
13201341
version: "dev"
13211342
### : Keep local pins as pin-depends

0 commit comments

Comments
 (0)