mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
Ignore ~/.gitconfig in tests and drop version test
git version 2.3 was released in 2015.
This commit is contained in:
parent
674786db96
commit
70a11b3d79
1 changed files with 132 additions and 142 deletions
|
@ -65,11 +65,6 @@ fdroid_init_with_prebuilt_keystore() {
|
||||||
echo 'keypass: r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' >> config.yml
|
echo 'keypass: r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=' >> config.yml
|
||||||
}
|
}
|
||||||
|
|
||||||
# the < is reverse since 0 means success in exit codes
|
|
||||||
have_git_2_3() {
|
|
||||||
python3 -c "import sys; from distutils.version import LooseVersion as V; sys.exit(V(sys.argv[3]) < V('2.3'))" `git --version`
|
|
||||||
}
|
|
||||||
|
|
||||||
is_MD5_disabled() {
|
is_MD5_disabled() {
|
||||||
javac $WORKSPACE/tests/IsMD5Disabled.java && java -cp $WORKSPACE/tests IsMD5Disabled
|
javac $WORKSPACE/tests/IsMD5Disabled.java && java -cp $WORKSPACE/tests IsMD5Disabled
|
||||||
}
|
}
|
||||||
|
@ -141,6 +136,11 @@ else
|
||||||
sed=sed
|
sed=sed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# allow the location of git to be overridden
|
||||||
|
if [ -z "$git" ]; then
|
||||||
|
git="env HOME= GIT_AUTHOR_NAME='Test' GIT_AUTHOR_EMAIL='no@mail' GIT_COMMITTER_NAME='Test' GIT_COMMITTER_EMAIL='no@mail' git"
|
||||||
|
fi
|
||||||
|
|
||||||
set -x # show each command as it is executed
|
set -x # show each command as it is executed
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
|
@ -1047,19 +1047,15 @@ fdroid_init_with_prebuilt_keystore
|
||||||
cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
|
cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/
|
||||||
echo "binary_transparency_remote: $GIT_REMOTE" >> config.yml
|
echo "binary_transparency_remote: $GIT_REMOTE" >> config.yml
|
||||||
$fdroid update --verbose
|
$fdroid update --verbose
|
||||||
if have_git_2_3; then
|
|
||||||
$fdroid deploy --verbose
|
$fdroid deploy --verbose
|
||||||
test -e repo/index.xml
|
test -e repo/index.xml
|
||||||
test -e repo/index.jar
|
test -e repo/index.jar
|
||||||
test -e repo/index-v1.jar
|
test -e repo/index-v1.jar
|
||||||
grep -F '<application id=' repo/index.xml > /dev/null
|
grep -F '<application id=' repo/index.xml > /dev/null
|
||||||
cd binary_transparency
|
cd binary_transparency
|
||||||
[ `git rev-list --count HEAD` == "2" ]
|
[ "$($git rev-list --count HEAD)" == "2" ]
|
||||||
cd $GIT_REMOTE
|
cd $GIT_REMOTE
|
||||||
[ `git rev-list --count HEAD` == "2" ]
|
[ "$($git rev-list --count HEAD)" == "2" ]
|
||||||
else
|
|
||||||
echo "Skipping test, `git --version` older than 2.3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
|
@ -1118,8 +1114,8 @@ echo_header "setup a new repo from scratch using ANDROID_HOME with git mirror"
|
||||||
# fake git remote server for repo mirror
|
# fake git remote server for repo mirror
|
||||||
SERVER_GIT_MIRROR=`create_test_dir`
|
SERVER_GIT_MIRROR=`create_test_dir`
|
||||||
cd $SERVER_GIT_MIRROR
|
cd $SERVER_GIT_MIRROR
|
||||||
git init
|
$git init
|
||||||
git config receive.denyCurrentBranch updateInstead
|
$git config receive.denyCurrentBranch updateInstead
|
||||||
|
|
||||||
REPOROOT=`create_test_dir`
|
REPOROOT=`create_test_dir`
|
||||||
GIT_MIRROR=$REPOROOT/git-mirror
|
GIT_MIRROR=$REPOROOT/git-mirror
|
||||||
|
@ -1161,15 +1157,14 @@ test -e $REPOROOT/archive/com.politedroid_3.apk
|
||||||
! test -e $SERVER_GIT_MIRROR/fdroid/archive/com.politedroid_3.apk
|
! test -e $SERVER_GIT_MIRROR/fdroid/archive/com.politedroid_3.apk
|
||||||
after=`du -s --bytes $GIT_MIRROR/.git/ | awk '{print $1}'`
|
after=`du -s --bytes $GIT_MIRROR/.git/ | awk '{print $1}'`
|
||||||
! test -e $GIT_MIRROR/.git/test-stamp
|
! test -e $GIT_MIRROR/.git/test-stamp
|
||||||
git -C $GIT_MIRROR gc
|
$git -C "$GIT_MIRROR" gc
|
||||||
git -C $SERVER_GIT_MIRROR gc
|
$git -C "$SERVER_GIT_MIRROR" gc
|
||||||
test $before -gt $after
|
test $before -gt $after
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
echo_header "sign binary repo in offline box, then publishing from online box"
|
echo_header "sign binary repo in offline box, then publishing from online box"
|
||||||
|
|
||||||
if have_git_2_3; then
|
|
||||||
OFFLINE_ROOT=`create_test_dir`
|
OFFLINE_ROOT=`create_test_dir`
|
||||||
KEYSTORE=$WORKSPACE/tests/keystore.p12
|
KEYSTORE=$WORKSPACE/tests/keystore.p12
|
||||||
LOCAL_COPY_DIR=`create_test_dir`/fdroid
|
LOCAL_COPY_DIR=`create_test_dir`/fdroid
|
||||||
|
@ -1181,7 +1176,7 @@ if have_git_2_3; then
|
||||||
cd $OFFLINE_ROOT
|
cd $OFFLINE_ROOT
|
||||||
mkdir binary_transparency
|
mkdir binary_transparency
|
||||||
cd binary_transparency
|
cd binary_transparency
|
||||||
git init
|
$git init
|
||||||
|
|
||||||
# fake git remote server for binary transparency log
|
# fake git remote server for binary transparency log
|
||||||
BINARY_TRANSPARENCY_REMOTE=`create_test_dir`
|
BINARY_TRANSPARENCY_REMOTE=`create_test_dir`
|
||||||
|
@ -1189,8 +1184,8 @@ if have_git_2_3; then
|
||||||
# fake git remote server for repo mirror
|
# fake git remote server for repo mirror
|
||||||
SERVER_GIT_MIRROR=`create_test_dir`
|
SERVER_GIT_MIRROR=`create_test_dir`
|
||||||
cd $SERVER_GIT_MIRROR
|
cd $SERVER_GIT_MIRROR
|
||||||
git init
|
$git init
|
||||||
git config receive.denyCurrentBranch updateInstead
|
$git config receive.denyCurrentBranch updateInstead
|
||||||
|
|
||||||
cd $OFFLINE_ROOT
|
cd $OFFLINE_ROOT
|
||||||
fdroid_init_with_prebuilt_keystore
|
fdroid_init_with_prebuilt_keystore
|
||||||
|
@ -1209,7 +1204,7 @@ if have_git_2_3; then
|
||||||
test `grep '<mirror>' repo/index.xml | wc -l` -eq 2
|
test `grep '<mirror>' repo/index.xml | wc -l` -eq 2
|
||||||
test `grep '<mirror>' archive/index.xml | wc -l` -eq 2
|
test `grep '<mirror>' archive/index.xml | wc -l` -eq 2
|
||||||
cd binary_transparency
|
cd binary_transparency
|
||||||
[ `git rev-list --count HEAD` == "1" ]
|
[ "$($git rev-list --count HEAD)" == "1" ]
|
||||||
cd ..
|
cd ..
|
||||||
$fdroid deploy --verbose
|
$fdroid deploy --verbose
|
||||||
test -e $LOCAL_COPY_DIR/unsigned/urzip-release-unsigned.apk
|
test -e $LOCAL_COPY_DIR/unsigned/urzip-release-unsigned.apk
|
||||||
|
@ -1224,10 +1219,9 @@ if have_git_2_3; then
|
||||||
test -e $ONLINE_ROOT/unsigned/urzip-release-unsigned.apk
|
test -e $ONLINE_ROOT/unsigned/urzip-release-unsigned.apk
|
||||||
test -e $SERVERWEBROOT/unsigned/urzip-release-unsigned.apk
|
test -e $SERVERWEBROOT/unsigned/urzip-release-unsigned.apk
|
||||||
cd $BINARY_TRANSPARENCY_REMOTE
|
cd $BINARY_TRANSPARENCY_REMOTE
|
||||||
[ `git rev-list --count HEAD` == "1" ]
|
[ "$($git rev-list --count HEAD)" == "1" ]
|
||||||
cd $SERVER_GIT_MIRROR
|
cd $SERVER_GIT_MIRROR
|
||||||
[ `git rev-list --count HEAD` == "1" ]
|
[ "$($git rev-list --count HEAD)" == "1" ]
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
|
@ -1298,24 +1292,23 @@ fi
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
echo_header "Test recovering from from broken git submodules"
|
echo_header "Test recovering from from broken git submodules"
|
||||||
|
|
||||||
if have_git_2_3; then
|
|
||||||
ROOT=$(create_test_dir)
|
ROOT=$(create_test_dir)
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
mkdir foo bar
|
mkdir foo bar
|
||||||
cd foo
|
cd foo
|
||||||
git init
|
$git init
|
||||||
echo a > a
|
echo a > a
|
||||||
git add a
|
$git add a
|
||||||
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit -m "a" --author "Author <no@mail>"
|
$git commit -m "a"
|
||||||
|
|
||||||
cd ../bar
|
cd ../bar
|
||||||
git init
|
$git init
|
||||||
git submodule add "file://$(pwd)/../foo" baz
|
$git submodule add "file://$(pwd)/../foo" baz
|
||||||
rm .gitmodules
|
rm .gitmodules
|
||||||
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit -am "a" --author "Author <no@mail>"
|
$git commit -am "a"
|
||||||
rm -rf baz
|
rm -rf baz
|
||||||
git checkout baz
|
$git checkout baz
|
||||||
git tag 2
|
$git tag 2
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
mkdir repo
|
mkdir repo
|
||||||
|
@ -1330,32 +1323,30 @@ if have_git_2_3; then
|
||||||
|
|
||||||
$fdroid checkupdates --allow-dirty
|
$fdroid checkupdates --allow-dirty
|
||||||
grep "CurrentVersionCode: 2" metadata/fake.yml
|
grep "CurrentVersionCode: 2" metadata/fake.yml
|
||||||
fi
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
echo_header "checkupdates ignore broken submodule"
|
echo_header "checkupdates ignore broken submodule"
|
||||||
|
|
||||||
if have_git_2_3; then
|
|
||||||
ROOT=$(create_test_dir)
|
ROOT=$(create_test_dir)
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
mkdir foo bar
|
mkdir foo bar
|
||||||
cd foo
|
cd foo
|
||||||
git init
|
$git init
|
||||||
echo a > a
|
echo a > a
|
||||||
git add a
|
$git add a
|
||||||
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit -m a --author "Author <no@mail>"
|
$git commit -m a
|
||||||
|
|
||||||
cd ../bar
|
cd ../bar
|
||||||
git init
|
$git init
|
||||||
git submodule add "file://$(pwd)/../foo" baz
|
$git submodule add "file://$(pwd)/../foo" baz
|
||||||
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit -am a --author "Author <no@mail>"
|
$git commit -am a
|
||||||
git tag 2
|
$git tag 2
|
||||||
|
|
||||||
cd ../foo
|
cd ../foo
|
||||||
# delete the commit referenced in bar
|
# delete the commit referenced in bar
|
||||||
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit --amend -m aa --author "Author <no@mail>"
|
$git commit --amend -m aa
|
||||||
git reflog expire --expire=now --all
|
$git reflog expire --expire=now --all
|
||||||
git gc --aggressive --prune=now
|
$git gc --aggressive --prune=now
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
mkdir repo
|
mkdir repo
|
||||||
|
@ -1374,7 +1365,6 @@ if have_git_2_3; then
|
||||||
|
|
||||||
$fdroid checkupdates --allow-dirty
|
$fdroid checkupdates --allow-dirty
|
||||||
grep "CurrentVersionCode: 2" metadata/fake.yml
|
grep "CurrentVersionCode: 2" metadata/fake.yml
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue