mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-06 11:00:13 +02:00
Merge branch 'release-test-overhaul' into 'master'
release test overhaul See merge request fdroid/fdroidserver!499
This commit is contained in:
commit
a76c5cc0b3
@ -30,6 +30,7 @@ metadata_v0:
|
|||||||
- git reset --hard
|
- git reset --hard
|
||||||
- git checkout $GITCOMMIT
|
- git checkout $GITCOMMIT
|
||||||
- cd fdroiddata
|
- cd fdroiddata
|
||||||
|
- echo "accepted_formats = ('txt', 'yml')" >> config.py
|
||||||
- ../tests/dump_internal_metadata_format.py
|
- ../tests/dump_internal_metadata_format.py
|
||||||
- sed -i
|
- sed -i
|
||||||
-e '/Translation:/d'
|
-e '/Translation:/d'
|
||||||
@ -79,6 +80,28 @@ ubuntu_lts:
|
|||||||
- cd tests
|
- cd tests
|
||||||
- ./run-tests
|
- ./run-tests
|
||||||
|
|
||||||
|
# test using TrustyLTS with all depends from pypi
|
||||||
|
ubuntu_trusty_pip:
|
||||||
|
image: ubuntu:trusty
|
||||||
|
only:
|
||||||
|
- master@fdroid/fdroidserver
|
||||||
|
variables:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
LANG: C.UTF-8
|
||||||
|
script:
|
||||||
|
- echo Etc/UTC > /etc/timezone
|
||||||
|
- apt-get -qy update
|
||||||
|
- apt-get -qy dist-upgrade
|
||||||
|
- apt-get -qy install git default-jdk python3-pip python3.4-venv
|
||||||
|
- rm -rf env
|
||||||
|
- pyvenv-3.4 env
|
||||||
|
- . env/bin/activate
|
||||||
|
- echo sed -i "s/'requests.*',$/'requests',/" setup.py
|
||||||
|
- pip3 install --upgrade babel pip setuptools
|
||||||
|
- pip3 install -e .
|
||||||
|
- ./setup.py compile_catalog
|
||||||
|
- ./tests/run-tests
|
||||||
|
|
||||||
pip_install:
|
pip_install:
|
||||||
image: archlinux/base
|
image: archlinux/base
|
||||||
only:
|
only:
|
||||||
@ -98,6 +121,30 @@ pip_install:
|
|||||||
- fdroid readmeta
|
- fdroid readmeta
|
||||||
- fdroid update --help
|
- fdroid update --help
|
||||||
|
|
||||||
|
pyup_io_safety_check:
|
||||||
|
image: archlinux/base
|
||||||
|
script:
|
||||||
|
- pacman --sync --sysupgrade --refresh --noconfirm grep python-pip python-virtualenv tar
|
||||||
|
- ./setup.py compile_catalog install
|
||||||
|
- pip install safety
|
||||||
|
- safety check --full-report
|
||||||
|
|
||||||
|
pylint:
|
||||||
|
image: alpine:3.7
|
||||||
|
variables:
|
||||||
|
LANG: C.UTF-8
|
||||||
|
script:
|
||||||
|
- apk add --no-cache ca-certificates python3
|
||||||
|
- python3 -m ensurepip
|
||||||
|
- pip3 install pylint
|
||||||
|
- pylint --rcfile=.pylint-rcfile --output-format=colorized --reports=n
|
||||||
|
fdroid
|
||||||
|
makebuildserver
|
||||||
|
setup.py
|
||||||
|
fdroidserver/*.py
|
||||||
|
tests/*.py
|
||||||
|
tests/*.TestCase
|
||||||
|
|
||||||
fedora_latest:
|
fedora_latest:
|
||||||
image: fedora:latest
|
image: fedora:latest
|
||||||
only:
|
only:
|
||||||
|
26
.travis.yml
26
.travis.yml
@ -24,27 +24,18 @@ matrix:
|
|||||||
# is used on Windows Subsystem for Linux.
|
# is used on Windows Subsystem for Linux.
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
|
update: true
|
||||||
sources:
|
sources:
|
||||||
- sourceline: 'ppa:fdroid/fdroidserver'
|
- sourceline: 'ppa:fdroid/fdroidserver'
|
||||||
packages:
|
packages:
|
||||||
- bash
|
|
||||||
- dash
|
|
||||||
- pylint
|
|
||||||
- pep8
|
|
||||||
- python3-babel
|
- python3-babel
|
||||||
- python3-dev
|
|
||||||
- python3-pip
|
|
||||||
- python3-ruamel.yaml
|
|
||||||
- python3-setuptools
|
- python3-setuptools
|
||||||
- python3.4-venv
|
|
||||||
- libjpeg-dev
|
|
||||||
- zlib1g-dev
|
|
||||||
- fdroidserver
|
- fdroidserver
|
||||||
|
|
||||||
android:
|
android:
|
||||||
components:
|
components:
|
||||||
- android-23 # required for `fdroid build` test
|
- android-23 # required for `fdroid build` test
|
||||||
- build-tools-25.0.3 # required for `fdroid build` test
|
- build-tools-27.0.3 # required for `fdroid build` test
|
||||||
licenses:
|
licenses:
|
||||||
- 'android-sdk-preview-.+'
|
- 'android-sdk-preview-.+'
|
||||||
- 'android-sdk-license-.+'
|
- 'android-sdk-license-.+'
|
||||||
@ -101,15 +92,12 @@ install:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# The OSX tests seem to run slower, they often timeout. So only run
|
# The OSX tests seem to run slower, they often timeout. So only run
|
||||||
# the test suite with the installed version of fdroid, instead of the
|
# the test suite with the installed version of fdroid.
|
||||||
# three rounds that ./complete-ci-tests does.
|
#
|
||||||
|
# Supporting pip on Ubuntu/trusty was too painful here, since it seems
|
||||||
|
# that pip installs conflict with the Ubuntu packages.
|
||||||
script:
|
script:
|
||||||
- cd tests
|
- ./tests/run-tests
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
||||||
./run-tests;
|
|
||||||
else
|
|
||||||
./complete-ci-tests;
|
|
||||||
fi
|
|
||||||
|
|
||||||
after_failure:
|
after_failure:
|
||||||
- cd $TRAVIS_BUILD_DIR
|
- cd $TRAVIS_BUILD_DIR
|
||||||
|
@ -163,7 +163,7 @@ def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_
|
|||||||
output['requests'] = requestsdict
|
output['requests'] = requestsdict
|
||||||
|
|
||||||
# establish sort order of the index
|
# establish sort order of the index
|
||||||
v1_sort_packages(packages, repodir, fdroid_signing_key_fingerprints)
|
v1_sort_packages(packages, fdroid_signing_key_fingerprints)
|
||||||
|
|
||||||
appslist = []
|
appslist = []
|
||||||
output['apps'] = appslist
|
output['apps'] = appslist
|
||||||
@ -252,7 +252,7 @@ def make_v1(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_
|
|||||||
signindex.sign_index_v1(repodir, json_name)
|
signindex.sign_index_v1(repodir, json_name)
|
||||||
|
|
||||||
|
|
||||||
def v1_sort_packages(packages, repodir, fdroid_signing_key_fingerprints):
|
def v1_sort_packages(packages, fdroid_signing_key_fingerprints):
|
||||||
"""Sorts the supplied list to ensure a deterministic sort order for
|
"""Sorts the supplied list to ensure a deterministic sort order for
|
||||||
package entries in the index file. This sort-order also expresses
|
package entries in the index file. This sort-order also expresses
|
||||||
installation preference to the clients.
|
installation preference to the clients.
|
||||||
|
@ -52,7 +52,7 @@ def publish_source_tarball(apkfilename, unsigned_dir, output_dir):
|
|||||||
logging.debug('...no source tarball for %s', apkfilename)
|
logging.debug('...no source tarball for %s', apkfilename)
|
||||||
|
|
||||||
|
|
||||||
def key_alias(appid, resolve=False):
|
def key_alias(appid):
|
||||||
"""Get the alias which F-Droid uses to indentify the singing key
|
"""Get the alias which F-Droid uses to indentify the singing key
|
||||||
for this App in F-Droids keystore.
|
for this App in F-Droids keystore.
|
||||||
"""
|
"""
|
||||||
|
@ -45,7 +45,7 @@ def extract_signature(apkpath):
|
|||||||
return sigdir
|
return sigdir
|
||||||
|
|
||||||
|
|
||||||
def extract(config, options):
|
def extract(options):
|
||||||
|
|
||||||
# Create tmp dir if missing…
|
# Create tmp dir if missing…
|
||||||
tmp_dir = 'tmp'
|
tmp_dir = 'tmp'
|
||||||
|
@ -107,5 +107,3 @@ fi
|
|||||||
../fdroid build --verbose --stop org.adaway:55
|
../fdroid build --verbose --stop org.adaway:55
|
||||||
# building old versions should still work
|
# building old versions should still work
|
||||||
../fdroid build --verbose --stop org.fdroid.fdroid:96150
|
../fdroid build --verbose --stop org.fdroid.fdroid:96150
|
||||||
# test OTA update ZIP build and publish
|
|
||||||
../fdroid build --verbose --stop org.fdroid.fdroid.privileged.ota:2070
|
|
||||||
|
5
setup.py
5
setup.py
@ -82,14 +82,15 @@ setup(name='fdroidserver',
|
|||||||
'babel',
|
'babel',
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
|
'androguard >= 3.1.0rc2',
|
||||||
'clint',
|
'clint',
|
||||||
'GitPython',
|
'GitPython',
|
||||||
'mwclient',
|
'mwclient',
|
||||||
'paramiko',
|
'paramiko',
|
||||||
'Pillow',
|
'Pillow',
|
||||||
'apache-libcloud >= 0.14.1',
|
'apache-libcloud >= 0.14.1',
|
||||||
'pyasn1',
|
'pyasn1 <0.5.0, >=0.4.1',
|
||||||
'pyasn1-modules',
|
'pyasn1-modules == 0.2.1',
|
||||||
'python-vagrant',
|
'python-vagrant',
|
||||||
'PyYAML',
|
'PyYAML',
|
||||||
'qrcode',
|
'qrcode',
|
||||||
|
@ -27,6 +27,11 @@ if [ -z $ANDROID_HOME ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! which pyvenv; then
|
||||||
|
echo "pyvenv required to run this test suite!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
apksource=$1
|
apksource=$1
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
@ -35,31 +40,12 @@ if [ -z $PIP_DOWNLOAD_CACHE ]; then
|
|||||||
export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache
|
export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
|
||||||
# required Java 7 or later keytool/jarsigner for :file support
|
|
||||||
|
|
||||||
export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
# run local tests, don't scan fdroidserver/ project for APKs
|
# run local tests, don't scan fdroidserver/ project for APKs
|
||||||
|
|
||||||
cd $WORKSPACE/tests
|
cd $WORKSPACE/tests
|
||||||
./run-tests $apksource
|
./run-tests $apksource
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
|
||||||
# find pyvenv, to support Ubuntu/trusty's python3.4-venv
|
|
||||||
|
|
||||||
if which pyvenv; then
|
|
||||||
pyvenv=pyvenv
|
|
||||||
elif which pyvenv-3.4; then
|
|
||||||
pyvenv=pyvenv-3.4
|
|
||||||
else
|
|
||||||
echo "pyvenv required to run this test suite!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
# make sure that translations do not cause stacktraces
|
# make sure that translations do not cause stacktraces
|
||||||
@ -78,10 +64,8 @@ done
|
|||||||
# test install using install direct from git repo
|
# test install using install direct from git repo
|
||||||
cd $WORKSPACE
|
cd $WORKSPACE
|
||||||
rm -rf $WORKSPACE/env
|
rm -rf $WORKSPACE/env
|
||||||
$pyvenv $WORKSPACE/env
|
pyvenv $WORKSPACE/env
|
||||||
. $WORKSPACE/env/bin/activate
|
. $WORKSPACE/env/bin/activate
|
||||||
# workaround https://github.com/pypa/setuptools/issues/937
|
|
||||||
pip3 install --quiet setuptools==33.1.1 Babel
|
|
||||||
pip3 install --quiet -e $WORKSPACE
|
pip3 install --quiet -e $WORKSPACE
|
||||||
python3 setup.py compile_catalog install
|
python3 setup.py compile_catalog install
|
||||||
|
|
||||||
@ -90,19 +74,3 @@ test -e $WORKSPACE/env/share/locale/de/LC_MESSAGES/fdroidserver.mo
|
|||||||
|
|
||||||
# run tests in new pip+pyvenv install
|
# run tests in new pip+pyvenv install
|
||||||
fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests $apksource
|
fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests $apksource
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
|
||||||
# run pylint
|
|
||||||
|
|
||||||
# only run it where it will work, for example, the pyvenvs above don't have pylint
|
|
||||||
if which pylint3 && python3 -c "import pylint" 2> /dev/null; then
|
|
||||||
cd $WORKSPACE
|
|
||||||
pylint3 --rcfile=.pylint-rcfile --output-format=colorized --reports=n \
|
|
||||||
fdroid \
|
|
||||||
makebuildserver \
|
|
||||||
setup.py \
|
|
||||||
fdroidserver/*.py \
|
|
||||||
tests/*.py \
|
|
||||||
tests/*.TestCase
|
|
||||||
fi
|
|
||||||
|
@ -211,7 +211,7 @@ class IndexTest(unittest.TestCase):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
fdroidserver.index.v1_sort_packages(
|
fdroidserver.index.v1_sort_packages(
|
||||||
i, 'repo', fdroidserver.common.load_stats_fdroid_signing_key_fingerprints())
|
i, fdroidserver.common.load_stats_fdroid_signing_key_fingerprints())
|
||||||
self.maxDiff = None
|
self.maxDiff = None
|
||||||
self.assertEqual(json.dumps(i, indent=2), json.dumps(o, indent=2))
|
self.assertEqual(json.dumps(i, indent=2), json.dumps(o, indent=2))
|
||||||
|
|
||||||
|
@ -156,6 +156,7 @@ $fdroid --version
|
|||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
echo_header 'run process when building and signing are on separate machines'
|
echo_header 'run process when building and signing are on separate machines'
|
||||||
|
|
||||||
|
if which zipalign || ls -1 $ANDROID_HOME/build-tools/*/zipalign; then
|
||||||
REPOROOT=`create_test_dir`
|
REPOROOT=`create_test_dir`
|
||||||
cd $REPOROOT
|
cd $REPOROOT
|
||||||
cp $WORKSPACE/tests/keystore.jks $REPOROOT/
|
cp $WORKSPACE/tests/keystore.jks $REPOROOT/
|
||||||
@ -180,7 +181,7 @@ test -e tmp/apkcache
|
|||||||
! test -z tmp/apkcache
|
! test -z tmp/apkcache
|
||||||
test -L urzip.apk
|
test -L urzip.apk
|
||||||
grep -F '<application id=' repo/index.xml > /dev/null
|
grep -F '<application id=' repo/index.xml > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
echo_header "test UTF-8 metadata"
|
echo_header "test UTF-8 metadata"
|
||||||
@ -1029,6 +1030,7 @@ test -e $KEYSTORE
|
|||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
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.jks
|
KEYSTORE=$WORKSPACE/tests/keystore.jks
|
||||||
LOCAL_COPY_DIR=`create_test_dir`/fdroid
|
LOCAL_COPY_DIR=`create_test_dir`/fdroid
|
||||||
@ -1049,9 +1051,7 @@ BINARY_TRANSPARENCY_REMOTE=`create_test_dir`
|
|||||||
SERVER_GIT_MIRROR=`create_test_dir`
|
SERVER_GIT_MIRROR=`create_test_dir`
|
||||||
cd $SERVER_GIT_MIRROR
|
cd $SERVER_GIT_MIRROR
|
||||||
git init
|
git init
|
||||||
if have_git_2_3; then
|
|
||||||
git config receive.denyCurrentBranch updateInstead
|
git config receive.denyCurrentBranch updateInstead
|
||||||
fi
|
|
||||||
|
|
||||||
cd $OFFLINE_ROOT
|
cd $OFFLINE_ROOT
|
||||||
fdroid_init_with_prebuilt_keystore
|
fdroid_init_with_prebuilt_keystore
|
||||||
@ -1084,6 +1084,7 @@ 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
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
|
@ -36,7 +36,7 @@ class SignaturesTest(unittest.TestCase):
|
|||||||
APK = [os.path.abspath(os.path.join('repo', 'com.politedroid_3.apk'))]
|
APK = [os.path.abspath(os.path.join('repo', 'com.politedroid_3.apk'))]
|
||||||
|
|
||||||
with TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
|
with TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
|
||||||
signatures.extract(common.config, OptionsFixture())
|
signatures.extract(OptionsFixture())
|
||||||
|
|
||||||
# check if extracted signatures are where they are supposed to be
|
# check if extracted signatures are where they are supposed to be
|
||||||
# also verify weather if extracted file contian what they should
|
# also verify weather if extracted file contian what they should
|
||||||
|
Loading…
Reference in New Issue
Block a user