forked from ocaml/opam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reftest: add a test for git packages with submodules
- Loading branch information
1 parent
6fc00fd
commit 1d62c4c
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ git config --global user.email "[email protected]" | |
git config --global user.name "Github Actions CI" | ||
git config --global gc.autoDetach false | ||
git config --global init.defaultBranch thisShouldNotHappen | ||
git config --global protocol.file.allow always | ||
|
||
if [ -d ~/opam-repository ]; then | ||
OPAM_REPO_CACHE=file://$HOME/opam-repository | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
N0REP0 | ||
### : Check the bevahiour when presented with a broken submodule | ||
### mkdir submodule | ||
### git -C ./submodule init -q | ||
### git -C ./submodule config core.autocrlf false | ||
### touch ./submodule/some-file | ||
### git -C ./submodule add ./some-file | ||
### git -C ./submodule commit -qm "first commit" | ||
### mkdir use-submodule | ||
### git -C ./use-submodule init -q | ||
### git -C ./use-submodule config core.autocrlf false | ||
### git -C ./use-submodule submodule add ../submodule ./vendor | ||
Cloning into '${BASEDIR}/use-submodule/vendor'... | ||
done. | ||
### git -C ./use-submodule commit -qm "first commit" | ||
### <create-submodule-pkg.sh> | ||
mkdir -p REPO/packages/submodule/submodule.1 | ||
ESCAPED_BASEDIR=$(printf '%s' "$BASEDIR" | sed 's/\\/\\\\/g') | ||
cat > REPO/packages/submodule/submodule.1/opam << EOF | ||
opam-version: "2.0" | ||
build: ["ls" "vendor/some-file"] | ||
url { | ||
src: "git+file://${ESCAPED_BASEDIR}/use-submodule" | ||
} | ||
EOF | ||
### sh ./create-submodule-pkg.sh | ||
### opam update | ||
|
||
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><> | ||
[default] synchronised from file://${BASEDIR}/REPO | ||
Now run 'opam upgrade' to apply any package updates. | ||
### opam switch create submodule --empty | ||
### opam install submodule | ||
The following actions will be performed: | ||
=== install 1 package | ||
- install submodule 1 | ||
|
||
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
-> retrieved submodule.1 (git+file://${BASEDIR}/use-submodule) | ||
-> installed submodule.1 | ||
Done. | ||
### rm -r ./submodule | ||
### opam remove submodule | ||
The following actions will be performed: | ||
=== remove 1 package | ||
- remove submodule 1 | ||
|
||
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
-> removed submodule.1 | ||
Done. | ||
### opam install submodule | ||
The following actions will be performed: | ||
=== install 1 package | ||
- install submodule 1 | ||
|
||
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
[WARNING] Git submodule update failed in ${BASEDIR}/OPAM/submodule/.opam-switch/sources/submodule.1 | ||
-> retrieved submodule.1 (git+file://${BASEDIR}/use-submodule) | ||
[ERROR] The compilation of submodule.1 failed at "ls vendor/some-file". | ||
|
||
##% output ### | ||
# ls: cannot access 'vendor/some-file': No such file or directory | ||
|
||
|
||
|
||
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> | ||
+- The following actions failed | ||
| - build submodule 1 | ||
+- | ||
- No changes have been performed | ||
# Return code 31 # |