e2e: move code around
This commit is contained in:
parent
b56ea3796a
commit
a6cce7b757
39
test_e2e.sh
39
test_e2e.sh
|
|
@ -78,6 +78,22 @@ if [[ -z "$DIR" ]]; then
|
||||||
fi
|
fi
|
||||||
echo "test root is $DIR"
|
echo "test root is $DIR"
|
||||||
|
|
||||||
|
REPO="$DIR/repo"
|
||||||
|
function init_repo() {
|
||||||
|
rm -rf "$REPO"
|
||||||
|
mkdir -p "$REPO"
|
||||||
|
git -C "$REPO" init -q
|
||||||
|
touch "$REPO"/file
|
||||||
|
git -C "$REPO" add file
|
||||||
|
git -C "$REPO" commit -aqm "init file"
|
||||||
|
}
|
||||||
|
|
||||||
|
ROOT="$DIR/root"
|
||||||
|
function clean_root() {
|
||||||
|
rm -rf "$ROOT"
|
||||||
|
mkdir -p "$ROOT"
|
||||||
|
}
|
||||||
|
|
||||||
function finish() {
|
function finish() {
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "The directory $DIR was not removed as it contains"\
|
echo "The directory $DIR was not removed as it contains"\
|
||||||
|
|
@ -85,9 +101,11 @@ function finish() {
|
||||||
remove_sync_container
|
remove_sync_container
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
trap finish INT EXIT
|
trap finish INT EXIT
|
||||||
|
|
||||||
|
SLOW_GIT=/slow_git.sh
|
||||||
|
ASKPASS_GIT=/askpass_git.sh
|
||||||
|
|
||||||
CONTAINER_NAME=git-sync-$RANDOM$RANDOM
|
CONTAINER_NAME=git-sync-$RANDOM$RANDOM
|
||||||
function GIT_SYNC() {
|
function GIT_SYNC() {
|
||||||
#./bin/linux_amd64/git-sync "$@"
|
#./bin/linux_amd64/git-sync "$@"
|
||||||
|
|
@ -111,25 +129,6 @@ function remove_sync_container() {
|
||||||
docker rm -f $CONTAINER_NAME >/dev/null 2>&1
|
docker rm -f $CONTAINER_NAME >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
SLOW_GIT=/slow_git.sh
|
|
||||||
ASKPASS_GIT=/askpass_git.sh
|
|
||||||
|
|
||||||
REPO="$DIR/repo"
|
|
||||||
function init_repo() {
|
|
||||||
rm -rf "$REPO"
|
|
||||||
mkdir -p "$REPO"
|
|
||||||
git -C "$REPO" init -q
|
|
||||||
touch "$REPO"/file
|
|
||||||
git -C "$REPO" add file
|
|
||||||
git -C "$REPO" commit -aqm "init file"
|
|
||||||
}
|
|
||||||
|
|
||||||
ROOT="$DIR/root"
|
|
||||||
function clean_root() {
|
|
||||||
rm -rf "$ROOT"
|
|
||||||
mkdir -p "$ROOT"
|
|
||||||
}
|
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
# Test HEAD one-time
|
# Test HEAD one-time
|
||||||
##############################################
|
##############################################
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue