diff --git a/debian/control b/debian/control index 5d6d3c1..71ebce8 100644 --- a/debian/control +++ b/debian/control @@ -1,24 +1,24 @@ Source: mirakuru Section: python Priority: optional Maintainer: Software Heritage Developers Build-Depends: debhelper (>= 11), - dh-python (>= 2), - python3-all, - python3-setuptools, + dh-python (>= 2), + netcat-traditional, + procps, + python3-all, + python3-daemon, + python3-mock, python3-psutil, - python3-pytest, - python3-pytest-cov, - python3-mock, - python3-daemon + python3-pytest, + python3-pytest-cov, + python3-setuptools Standards-Version: 4.1.3 Homepage: https://github.com/ClearcodeHQ/mirakuru Package: python3-mirakuru Architecture: all -Depends: python3-psutil, - ${misc:Depends}, - ${python3:Depends} +Depends: python3-psutil, ${misc:Depends}, ${python3:Depends} Description: Process executor for tests Mirakuru is a process orchestration tool designed for functional and integration tests. diff --git a/debian/patches/0002-Use-proper-nc-l-p-commands-for-tests.patch b/debian/patches/0002-Use-proper-nc-l-p-commands-for-tests.patch new file mode 100644 index 0000000..e40ac52 --- /dev/null +++ b/debian/patches/0002-Use-proper-nc-l-p-commands-for-tests.patch @@ -0,0 +1,30 @@ +From: Nicolas Dandrimont +Date: Wed, 23 Oct 2019 16:13:48 +0200 +Subject: Use proper nc -l -p commands for tests + +--- + tests/executors/test_tcp_executor.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/executors/test_tcp_executor.py b/tests/executors/test_tcp_executor.py +index 2dd2920..e32ba6f 100644 +--- a/tests/executors/test_tcp_executor.py ++++ b/tests/executors/test_tcp_executor.py +@@ -18,7 +18,7 @@ HTTP_SERVER = f'{HTTP_SERVER_CMD} {PORT}' + + def test_start_and_wait(): + """Test if executor await for process to accept connections.""" +- command = 'bash -c "sleep 2 && nc -l 3000"' ++ command = 'bash -c "sleep 2 && nc -l -p 3000"' + executor = TCPExecutor(command, 'localhost', port=3000, timeout=5) + executor.start() + +@@ -32,7 +32,7 @@ def test_start_and_wait(): + + def test_it_raises_error_on_timeout(): + """Check if TimeoutExpired gets raised correctly.""" +- command = 'bash -c "sleep 10 && nc -l 3000"' ++ command = 'bash -c "sleep 10 && nc -l -p 3000"' + executor = TCPExecutor(command, host='localhost', port=3000, timeout=2) + + with pytest.raises(TimeoutExpired): diff --git a/debian/patches/series b/debian/patches/series index 9dfe109..6e45acc 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Update-tests-to-use-python3-instead-of-python.patch +0002-Use-proper-nc-l-p-commands-for-tests.patch diff --git a/debian/pybuild.testfiles b/debian/pybuild.testfiles new file mode 100644 index 0000000..7aaa46b --- /dev/null +++ b/debian/pybuild.testfiles @@ -0,0 +1,2 @@ +tests +pytest.ini diff --git a/debian/rules b/debian/rules index cd3adae..5df9940 100755 --- a/debian/rules +++ b/debian/rules @@ -1,9 +1,6 @@ #!/usr/bin/make -f export PYBUILD_NAME=mirakuru %: dh $@ --with python3 --buildsystem=pybuild - -override_dh_auto_test: - echo "Skipping not included tests..."