Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #11781

pybuild mysteriously does not copy all testfiles

From IOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>
Newsgroups linux.debian.maint.python
Subject pybuild mysteriously does not copy all testfiles
Date 2019-09-10 16:00 +0200
Message-ID <yEOQx-1jy-5@gated-at.bofh.it> (permalink)
Organization Debian/GNU

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

updating one of my packages (python-can), the test-suite started to
fail, with an error-code 5, indicating that "no tests have been run".

since there *are* tests to be run, i investigated and - after scratching
my head - found that 'pybuild' did not fully copy the test-directory
from the source-directory to the build directory.

The sources "test/" directory contains:
```
test/serial_test.py
test/test_slcan.py
test/test_cyclic_socketcan.py
test/data/logfile.blf
test/data/__init__.py
test/data/example_data.py
test/data/logfile.asc
test/test_bit_timing.py
test/zero_dlc_test.py
test/test_systec.py
test/open_vcan.sh
test/message_helper.py
test/contextmanager_test.py
test/test_detect_available_configs.py
test/test_message_sync.py
test/notifier_test.py
test/config.py
test/simplecyclic_test.py
test/test_scripts.py
test/logformats_test.py
test/listener_test.py
test/back2back_test.py
test/test_message_class.py
test/__init__.py
test/test_message_filtering.py
test/test_socketcan.py
test/test_kvaser.py
test/test_viewer.py
test/network_test.py
test/test_vector.py
test/test_socketcan_helpers.py
test/test_load_file_config.py
```

However, ".pybuild/cpython3_3.7_can/build/test/" contains only: (after
dh_auto_test failed):
```
test/data/__init__.py
test/data/example_data.py
```

d/rules is pretty standard:
```
#! /usr/bin/make -f
export PYBUILD_NAME=can
include /usr/share/dpkg/default.mk
export DEB_VERSION_UPSTREAM
%:
        dh $@ --with python3,sphinxdoc --buildsystem=pybuild
override_dh_clean:
        dh_clean
        rm -f test.asc test.csv
        rm -rf .pytest_cache/
override_dh_auto_build:
        dh_auto_build
        python3 -m sphinx -E -T -b html doc .pybuild/docs/html/
override_dh_auto_install:
        dh_auto_install
        -for f in debian/*/usr/bin/*.py; do mv $$f $${f%.py}; done
        -rm -f debian/*/usr/lib/python*/dist-packages/test.???
```

and the package does not contain d/pybuild.testfiles or similar.

Now if I add a file from tests (say "test/network_test.py") to
d/pybuild.testfiles, that file is copied (although into
.pybuild/cpython3_3.7_can/build/ rather than into
.pybuild/cpython3_3.7_can/build/test/) and runs correctly.
adding "test/" to d/pybuild.testfiles (with or without the trailing
slash) did not do anything (apart from the original behaviour of only
copying 2 files).
doing something like "find test -type f > d/pybuild.testfiles" copied
all files, however the directory structure was lost (all files ended up
in .pybuild/cpython3_3.7_can/build/), and the tests started to fail as
they didn't find files in the subdirectories as expected.

i'm totally stumified.

an intermediate hack i found to work is to manually copy the "test/"
directoy into the build-dir, using:
export PYBUILD_BEFORE_TEST=cp -r {dir}/test {build_dir}

but that seems extraordinarily clumsy. esp. since pybuild(1) says:
> By default only test and tests directories are copied to build
> directory.

any ideas what does wrong?
mgfdsar
IOhannes

Back to linux.debian.maint.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

pybuild mysteriously does not copy all testfiles IOhannes m zmölnig (Debian/GNU)  <umlaeute@debian.org> - 2019-09-10 16:00 +0200
  Re: pybuild mysteriously does not copy all testfiles Ole Streicher <olebole@debian.org> - 2019-09-10 16:40 +0200
    Re: pybuild mysteriously does not copy all testfiles IOhannes m zmölnig (Debian/GNU)  <umlaeute@debian.org> - 2019-09-12 10:30 +0200

csiph-web