[keras] 02/07: Run tests via pytest and add autopkgtest.
Stephen Sinclair
sinclairs-guest at moszumanska.debian.org
Thu Nov 9 15:27:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
sinclairs-guest pushed a commit to branch master
in repository keras.
commit 062c1557be7143502ddf245dac688c060f2f5c8d
Author: Stephen Sinclair <radarsat1 at gmail.com>
Date: Mon Nov 6 15:15:37 2017 -0300
Run tests via pytest and add autopkgtest.
---
debian/control | 3 +++
debian/rules | 25 ++++++++++++++++++++++++-
debian/tests/control | 2 ++
debian/tests/python3-theano-cpu | 13 +++++++++++++
4 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/debian/control b/debian/control
index 66ef729..25c7292 100644
--- a/debian/control
+++ b/debian/control
@@ -15,6 +15,9 @@ Build-Depends:
python3-scipy,
python3-theano,
python3-h5py,
+ python3-pytest,
+ python3-pandas,
+ python3-pil,
markdown,
links
Standards-Version: 4.1.1
diff --git a/debian/rules b/debian/rules
index c60b3d9..fa23886 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,11 +5,34 @@ export PYBUILD_NAME=keras
export THEANO_FLAGS=base_compiledir='.pybuild'
+# require tensorflow but not SKIPPED
+TESTSTOIGNORE=\
+ tests/keras/layers/cudnn_recurrent_test.py \
+ tests/keras/utils/multi_gpu_test.py
+
+# failure: ActivityRegularizer class doesn't have any documentation
+TESTSTOIGNORE+=tests/test_documentation.py
+
+# internal failure, bad function calls
+TESTSTOIGNORE+=\
+ tests/integration_tests/test_image_data_tasks.py \
+ tests/integration_tests/test_temporal_data_tasks.py \
+ tests/keras/applications/imagenet_utils_test.py \
+ tests/keras/backend/backend_test.py
+
+# need to access the internet
+TESTSTOIGNORE+=\
+ tests/keras/applications/imagenet_utils_test.py
+
+IGNORETESTS=$(TESTSTOIGNORE:%=--ignore=%)
+
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_auto_test:
- # ImportError: No module named tensorflow (#804612)
+# Run tests using Theano backend and CPU device.
+# Not every test is expected to pass, so we run a subset here:
+ PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="PYTHONPATH=.pybuild/pythonX.Y_{version}/build py.test-3 -oaddopts=-v $(IGNORETESTS)" dh_auto_test
override_dh_installdocs:
markdown README.md > .pybuild/README.html
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..7555d3b
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: python3-theano-cpu
+Depends: python3-keras, python3-pytest
diff --git a/debian/tests/python3-theano-cpu b/debian/tests/python3-theano-cpu
new file mode 100755
index 0000000..8edfe0b
--- /dev/null
+++ b/debian/tests/python3-theano-cpu
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Tests must use Theano backend with CPU device
+export KERAS_BACKEND=theano
+export THEANO_FLAGS='device=cpu'
+
+# python3.Y at build time, python3 at CI time
+PYINTERPRETER=${PYINTERPRETER:-python3}
+
+# Python module successfully imported and executed
+${PYINTERPRETER} -c 'import keras;'
+
+# Not supposed to run the actual unittests here so nothing more to do.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/keras.git
More information about the debian-science-commits
mailing list