Add volume mount for the repo sync test
This commit is contained in:
parent
9780b620c0
commit
c3791f59b2
15
test_e2e.sh
15
test_e2e.sh
|
|
@ -110,8 +110,9 @@ function clean_work() {
|
|||
mkdir -p "$WORK"
|
||||
}
|
||||
|
||||
# REPO is the source repo under test.
|
||||
# REPO and REPO2 are the source repos under test.
|
||||
REPO="$DIR/repo"
|
||||
REPO2="${REPO}2"
|
||||
MAIN_BRANCH="e2e-branch"
|
||||
function init_repo() {
|
||||
rm -rf "$REPO"
|
||||
|
|
@ -120,6 +121,9 @@ function init_repo() {
|
|||
touch "$REPO"/file
|
||||
git -C "$REPO" add file
|
||||
git -C "$REPO" commit -aqm "init file"
|
||||
|
||||
rm -rf "$REPO2"
|
||||
cp -r "$REPO" "$REPO2"
|
||||
}
|
||||
|
||||
# ROOT is the volume (usually) used as --root.
|
||||
|
|
@ -156,6 +160,7 @@ function GIT_SYNC() {
|
|||
-u $(id -u):$(id -g) \
|
||||
-v "$ROOT":"$ROOT":rw \
|
||||
-v "$REPO":"$REPO":ro \
|
||||
-v "$REPO2":"$REPO2":ro \
|
||||
-v "$WORK":"$WORK":ro \
|
||||
-v "$(pwd)/slow_git_clone.sh":"$SLOW_GIT_CLONE":ro \
|
||||
-v "$(pwd)/slow_git_fetch.sh":"$SLOW_GIT_FETCH":ro \
|
||||
|
|
@ -432,14 +437,12 @@ function e2e::repo_sync() {
|
|||
assert_file_eq "$ROOT"/link/file "$FUNCNAME 1"
|
||||
|
||||
# Prepare other repo
|
||||
OTHER_REPO="${REPO}2"
|
||||
cp -r "$REPO" "$OTHER_REPO"
|
||||
echo "$FUNCNAME 2" > "$OTHER_REPO"/file
|
||||
git -C "$OTHER_REPO" commit -qam "$FUNCNAME 2"
|
||||
echo "$FUNCNAME 2" > "$REPO2"/file
|
||||
git -C "$REPO2" commit -qam "$FUNCNAME 2"
|
||||
|
||||
# Now sync the other repo
|
||||
GIT_SYNC \
|
||||
--repo="file://$OTHER_REPO" \
|
||||
--repo="file://$REPO2" \
|
||||
--branch="$MAIN_BRANCH" \
|
||||
--root="$ROOT" \
|
||||
--dest="link" \
|
||||
|
|
|
|||
Loading…
Reference in New Issue