issue #477: add mitogen_py24 CI test type.

Butcher the crap out of run_tests because we don't have/want/need
coverage on 2.4.
issue510
David Wilson 5 years ago
parent 767331d76f
commit cab0b2cb9a

@ -0,0 +1,14 @@
#!/usr/bin/env python
import ci_lib
batches = [
[
'docker pull %s' % (ci_lib.image_for_distro(ci_lib.DISTRO),),
],
[
'sudo tar -C / -jxvf tests/data/ubuntu-python-2.4.6.tar.bz2',
]
]
ci_lib.run_batches(batches)

@ -0,0 +1,17 @@
#!/usr/bin/env python
# Mitogen tests for Python 2.4.
import os
import ci_lib
os.environ.update({
'NOCOVERAGE': '1',
'UNIT2': '/usr/local/python2.4.6/bin/unit2',
'MITOGEN_TEST_DISTRO': ci_lib.DISTRO,
'MITOGEN_LOG_LEVEL': 'debug',
'SKIP_ANSIBLE': '1',
})
ci_lib.run('./run_tests -v')

@ -8,16 +8,25 @@ echo
set -o errexit
set -o pipefail
UNIT2="$(which unit2)"
if [ ! "$UNIT2" ]; then
UNIT2="$(which unit2)"
fi
coverage erase
[ "$NOCOVERAGE" ] || coverage erase
# First run overwites coverage output.
[ "$SKIP_MITOGEN" ] || {
coverage run "${UNIT2}" discover \
--start-directory "tests" \
--pattern '*_test.py' \
"$@"
if [ ! "$NOCOVERAGE" ]; then
coverage run "${UNIT2}" discover \
--start-directory "tests" \
--pattern '*_test.py' \
"$@"
else
"${UNIT2}" discover \
--start-directory "tests" \
--pattern '*_test.py' \
"$@"
fi
}
# Second run appends. This is since 'discover' treats subdirs as packages and
@ -27,11 +36,18 @@ coverage erase
# mess of Git history.
[ "$SKIP_ANSIBLE" ] || {
export PYTHONPATH=`pwd`/tests:$PYTHONPATH
coverage run -a "${UNIT2}" discover \
--start-directory "tests/ansible" \
--pattern '*_test.py' \
"$@"
if [ ! "$NOCOVERAGE" ]; then
coverage run -a "${UNIT2}" discover \
--start-directory "tests/ansible" \
--pattern '*_test.py' \
"$@"
else
coverage run -a "${UNIT2}" discover \
--start-directory "tests/ansible" \
--pattern '*_test.py' \
"$@"
fi
}
coverage html
echo coverage report is at "file://$(pwd)/htmlcov/index.html"
[ "$NOCOVERAGE" ] || coverage html
[ "$NOCOVERAGE" ] || echo coverage report is at "file://$(pwd)/htmlcov/index.html"

Loading…
Cancel
Save