commit
d1393dd6fe
9 changed files with 77 additions and 54 deletions
56
Makefile
56
Makefile
|
@ -5,56 +5,6 @@ TEST_PACKAGE_DEPS := build-essential python python-pip procps python-dev python-
|
||||||
|
|
||||||
DOCKER_RUN_TEST := docker run -v $(PWD):/mnt:ro
|
DOCKER_RUN_TEST := docker run -v $(PWD):/mnt:ro
|
||||||
|
|
||||||
# test installation using Debian packages
|
|
||||||
DOCKER_DEB_TEST := sh -euxc ' \
|
|
||||||
apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends $(TEST_PACKAGE_DEPS) \
|
|
||||||
&& dpkg -i /mnt/dist/*.deb \
|
|
||||||
&& tmp=$$(mktemp -d) \
|
|
||||||
&& cp -r /mnt/* "$$tmp" \
|
|
||||||
&& cd "$$tmp" \
|
|
||||||
&& pip install --upgrade pip \
|
|
||||||
&& hash -r \
|
|
||||||
&& pip --version \
|
|
||||||
&& pip install --upgrade setuptools distribute \
|
|
||||||
&& pip install -r requirements-dev.txt \
|
|
||||||
&& py.test tests/ \
|
|
||||||
&& exec dumb-init /mnt/tests/test-zombies \
|
|
||||||
'
|
|
||||||
|
|
||||||
# test installation using `pip install`
|
|
||||||
DOCKER_PYTHON_TEST := sh -uexc ' \
|
|
||||||
apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends $(TEST_PACKAGE_DEPS) \
|
|
||||||
&& tmp=$$(mktemp -d) \
|
|
||||||
&& cp -r /mnt/* "$$tmp" \
|
|
||||||
&& cd "$$tmp" \
|
|
||||||
&& python setup.py clean \
|
|
||||||
&& python setup.py sdist \
|
|
||||||
&& pip install --upgrade pip \
|
|
||||||
&& hash -r \
|
|
||||||
&& pip install --upgrade setuptools distribute \
|
|
||||||
&& pip install -vv dist/*.tar.gz \
|
|
||||||
&& pip install -r requirements-dev.txt \
|
|
||||||
&& py.test tests/ \
|
|
||||||
&& exec dumb-init /mnt/tests/test-zombies \
|
|
||||||
'
|
|
||||||
|
|
||||||
# test several Python versions using tox
|
|
||||||
DOCKER_TOX_TEST := sh -uexc ' \
|
|
||||||
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x5BB92C09DB82666C \
|
|
||||||
&& echo "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial main" >> /etc/apt/sources.list \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends python2.6-dev python2.7-dev python3.4-dev python3.5-dev git $(TEST_PACKAGE_DEPS) \
|
|
||||||
&& echo "We cannot use the Ubuntu versions of tox or virtualenv:" \
|
|
||||||
&& echo "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754248" \
|
|
||||||
&& pip install tox virtualenv \
|
|
||||||
&& hash -r \
|
|
||||||
&& tmp=$$(mktemp -du) \
|
|
||||||
&& cp -r /mnt "$$tmp" \
|
|
||||||
&& cd "$$tmp" \
|
|
||||||
&& tox \
|
|
||||||
'
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: VERSION.h
|
build: VERSION.h
|
||||||
$(CC) $(CFLAGS) -o dumb-init dumb-init.c
|
$(CC) $(CFLAGS) -o dumb-init dumb-init.c
|
||||||
|
@ -124,13 +74,13 @@ itest_jessie: _itest-debian-jessie
|
||||||
itest_stretch: _itest-debian-stretch
|
itest_stretch: _itest-debian-stretch
|
||||||
|
|
||||||
itest_tox:
|
itest_tox:
|
||||||
$(DOCKER_RUN_TEST) ubuntu:xenial $(DOCKER_TOX_TEST)
|
$(DOCKER_RUN_TEST) ubuntu:xenial /mnt/ci/docker-tox-test
|
||||||
|
|
||||||
_itest-%: _itest_deb-% _itest_python-%
|
_itest-%: _itest_deb-% _itest_python-%
|
||||||
@true
|
@true
|
||||||
|
|
||||||
_itest_python-%:
|
_itest_python-%:
|
||||||
$(DOCKER_RUN_TEST) $(shell sed 's/-/:/' <<< "$*") $(DOCKER_PYTHON_TEST)
|
$(DOCKER_RUN_TEST) $(shell sed 's/-/:/' <<< "$*") /mnt/ci/docker-python-test
|
||||||
|
|
||||||
_itest_deb-%: builddeb-docker
|
_itest_deb-%: builddeb-docker
|
||||||
$(DOCKER_RUN_TEST) $(shell sed 's/-/:/' <<< "$*") $(DOCKER_DEB_TEST)
|
$(DOCKER_RUN_TEST) $(shell sed 's/-/:/' <<< "$*") /mnt/ci/docker-deb-test
|
||||||
|
|
23
ci/docker
Normal file
23
ci/docker
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
if grep -qE '\<lucid\>' /etc/apt/sources.list; then
|
||||||
|
# lucid was archived, breaking the base image
|
||||||
|
# https://github.com/docker-library/official-images/issues/1902
|
||||||
|
sed -i 's/archive\.ubuntu\.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
|
||||||
|
fi
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
build-essential \
|
||||||
|
procps \
|
||||||
|
python \
|
||||||
|
python-dev \
|
||||||
|
python-pip \
|
||||||
|
python-setuptools
|
||||||
|
|
||||||
|
pip install --upgrade pip
|
||||||
|
hash -r
|
||||||
|
pip --version
|
||||||
|
|
||||||
|
cp -r /mnt/ /test
|
||||||
|
cd /test
|
||||||
|
|
||||||
|
# vim: ft=sh
|
11
ci/docker-deb-test
Executable file
11
ci/docker-deb-test
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash -eux
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
. /mnt/ci/docker
|
||||||
|
|
||||||
|
dpkg -i dist/*.deb
|
||||||
|
pip install --upgrade setuptools distribute
|
||||||
|
pip install -r requirements-dev.txt
|
||||||
|
py.test tests/
|
||||||
|
|
||||||
|
exec dumb-init /mnt/tests/test-zombies
|
13
ci/docker-python-test
Executable file
13
ci/docker-python-test
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash -eux
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
. /mnt/ci/docker
|
||||||
|
|
||||||
|
python setup.py clean
|
||||||
|
python setup.py sdist
|
||||||
|
pip install --upgrade setuptools distribute
|
||||||
|
pip install -vv dist/*.tar.gz
|
||||||
|
pip install -r requirements-dev.txt
|
||||||
|
py.test tests/
|
||||||
|
|
||||||
|
exec dumb-init /mnt/tests/test-zombies \
|
21
ci/docker-tox
Normal file
21
ci/docker-tox
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash -eux
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
. /mnt/ci/docker
|
||||||
|
|
||||||
|
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x5BB92C09DB82666C
|
||||||
|
echo 'deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial main' >> /etc/apt/sources.list
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
git \
|
||||||
|
python2.6-dev \
|
||||||
|
python2.7-dev \
|
||||||
|
python3.4-dev \
|
||||||
|
python3.5-dev
|
||||||
|
|
||||||
|
# We cannot use the Ubuntu versions of tox or virtualenv:
|
||||||
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754248
|
||||||
|
pip install tox virtualenv
|
||||||
|
hash -r
|
||||||
|
|
||||||
|
tox
|
4
ci/docker-tox-test
Executable file
4
ci/docker-tox-test
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash -eux
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
. /mnt/ci/docker
|
|
@ -14,5 +14,5 @@ dependencies:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- CI/circle:
|
- ci/circle:
|
||||||
parallel: true
|
parallel: true
|
||||||
|
|
1
tox.ini
1
tox.ini
|
@ -3,6 +3,7 @@ envlist = py26,py27,py34,py35
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps = -r{toxinidir}/requirements-dev.txt
|
deps = -r{toxinidir}/requirements-dev.txt
|
||||||
|
passenv = HOME SSH_AUTH_SOCK USER
|
||||||
commands =
|
commands =
|
||||||
python -m pytest
|
python -m pytest
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
|
|
Loading…
Reference in a new issue