Control: retitle -1 python-scrapy: FTBFS without network access due to 
test_command_check.py
Control: severity -1 serious

On Sun, 24 Jan 2021 11:52:53 +0800 Paul Wise wrote:

> When I rebuild python-scrapy in pbuilder, I get a FTBFS due to the
> tests in tests/test_command_check.py failing unless I enable the use of
> the network using the --use-network=yes option.

I'm told the test in question uses contracts, which is scrapy's way of
testing that downloads the webpage live and checks if it is able to
scrape expected fields and links from that webpage, so, passing the
test-suite would definitely need network access.

   https://scrapy2.readthedocs.io/en/latest/topics/contracts.html

The Debian Policy about network access during build is fairly clear, it
isn't allowed except to things started by the build itself:

   
https://www.debian.org/doc/debian-policy/ch-source.html#main-building-script-debian-rules

   For packages in the main archive, no required targets may attempt
   network access, except, via the loopback interface, to services on the
   build host that have been started by the build.

Since the upstream pytest configuration just runs all tests in the
tests directory I think a simple way of solving this will be to delete
the offending test file before the tests run, via PYBUILD_BEFORE_TEST:

   $ grep -A3 pytest pytest.ini | grep py
   [pytest]
   python_files=test_*.py __init__.py
   
   $ grep -i test debian/rules 
   export PYBUILD_BEFORE_TEST=cd {dir}/tests/keys; cat example-com.key.pem 
example-com.cert.pem >cert.pem

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to