Debian Codegraph @

tests/run-ubuntu

raw
1 #!/bin/sh
2 set -eux
3
4 # go-faster apt
5 echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/90nolanguages
6
7 # upgrade
8 export DEBIAN_FRONTEND=noninteractive
9 apt-get update
10 apt-get install -y eatmydata
11 eatmydata apt-get -y --purge dist-upgrade
12
13 # install build dependencies
14 eatmydata apt-get install --no-install-recommends -y git \
15 python3-all python3-setuptools python3-setuptools-scm python3-build python3-venv \
16 python3-dbus python3-pytest python3-gi gir1.2-glib-2.0 \
17 dbus libnotify-bin upower network-manager bluez ofono ofono-scripts power-profiles-daemon
18
19 # systemd's tools otherwise fail on "not been booted with systemd"
20 mkdir -p /run/systemd/system
21
22 # run build and test as user
23 useradd build
24 su -s /bin/sh - build << EOF || { [ -z "$DEBUG" ] || sleep infinity; exit 1; }
25 set -ex
26 export SKIP_STATIC_CHECKS="$SKIP_STATIC_CHECKS"
27 cp -r $(pwd) /tmp/source
28 cd /tmp/source
29 python3 -m unittest -v
30 python3 -m pytest -vv -k 'test_pytest or TestAPI'
31 # massively parallel test to check for races
32 for i in \$(seq 100); do
33 ( PYTHONPATH=. python3 tests/test_api.py TestTemplates || touch /tmp/fail ) &
34 done
35 wait
36 [ ! -e /tmp/fail ]
37
38 my_version=\$(git describe --abbrev=0)
39
40 # test sdist with PyPA build
41 python3 -m build --sdist
42 tar --wildcards --strip-components=1 -xvf dist/python_dbusmock-\${my_version}*.tar.gz '*/PKG-INFO'
43 grep "^Version: \${my_version}" PKG-INFO
44 grep "^## Purpose" PKG-INFO
45 EOF