Skip to content

Commit b8da39b

Browse files
Fix one of the conversion tests with a local repo
Signed-off-by: Marek Kubica <[email protected]>
1 parent c5e6971 commit b8da39b

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

test/blackbox-tests/test-cases/pkg/opam-source-conversion.t

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Unsupported backends:
6161
> }
6262
> EOF
6363

64-
$ solve testpkg 2>&1
64+
$ solve testpkg
6565
Solution for dune.lock:
6666
- testpkg.0.0.1
6767
$ showpkg
@@ -72,6 +72,15 @@ Unsupported backends:
7272
(url hg+http://no-support.com/foo)
7373
(checksum md5=069aa55d40e548280f92af693f6c625a)))
7474

75+
Create a local git repo to resolve to
76+
77+
$ mkdir _repo
78+
$ git -C _repo init --initial-branch=main --quiet
79+
$ touch _repo/content
80+
$ git -C _repo add -A
81+
$ git -C _repo commit -m "Initial commit" --quiet
82+
$ expected_hash=$(git -C _repo rev-parse HEAD)
83+
7584
git+http
7685

7786
$ rm -rf ${default_lock_dir}
@@ -82,7 +91,7 @@ git+http
8291
> }
8392
> EOF
8493

85-
$ solve testpkg 2>&1
94+
$ solve testpkg
8695
Solution for dune.lock:
8796
- testpkg.0.0.1
8897
$ showpkg
@@ -98,19 +107,20 @@ git+file
98107
$ rm -rf ${default_lock_dir}
99108
$ mkpkg testpkg <<EOF
100109
> url {
101-
> src: "git+file://here"
110+
> src: "git+file://$PWD/_repo"
102111
> checksum: "md5=069aa55d40e548280f92af693f6c625a"
103112
> }
104113
> EOF
105-
$ solve testpkg 2>&1
114+
$ solve testpkg
106115
Solution for dune.lock:
107116
- testpkg.0.0.1
108-
$ showpkg
117+
$ showpkg | dune_cmd subst "$PWD" '$PWD' | dune_cmd subst "$expected_hash" '$EXPECTED_HASH'
109118
(version 0.0.1)
110119

111120
(source
112121
(fetch
113-
(url git+file://here)
122+
(url
123+
git+file://$PWD/_repo#$EXPECTED_HASH)
114124
(checksum md5=069aa55d40e548280f92af693f6c625a)))
115125

116126
git+foobar
@@ -122,7 +132,7 @@ git+foobar
122132
> checksum: "md5=069aa55d40e548280f92af693f6c625a"
123133
> }
124134
> EOF
125-
$ solve testpkg 2>&1
135+
$ solve testpkg
126136
Solution for dune.lock:
127137
- testpkg.0.0.1
128138
$ showpkg
@@ -142,7 +152,7 @@ file+git
142152
> checksum: "md5=069aa55d40e548280f92af693f6c625a"
143153
> }
144154
> EOF
145-
$ solve testpkg 2>&1
155+
$ solve testpkg
146156
Solution for dune.lock:
147157
- testpkg.0.0.1
148158
$ showpkg

0 commit comments

Comments
 (0)