fabio icon indicating copy to clipboard operation
fabio copied to clipboard

test failure when the network is not reachable.

Open picca opened this issue 7 years ago • 6 comments

Hello, when building fabio, the test gives some errors because it try to download a bunch of files.

It would be nice if these test could be skipped.

thanks

Fred

picca avatar Sep 06 '17 14:09 picca

======================================================================
ERROR: test_read (fabio.test.testmpaimage.TestMpa)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<BUILDDIR>>/python-fabio-0.5.0+dfsg/.pybuild/pythonX.Y_2.7/build/fabio/test/testmpaimage.py", line 54, in test_read
    path = UtilsTest.getimage(name + ".bz2")[:-4]
  File "/<<BUILDDIR>>/python-fabio-0.5.0+dfsg/.pybuild/pythonX.Y_2.7/build/fabio/test/utilstest.py", line 186, in getimage
    data=None, timeout=cls.timeout).read()
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 111] Connection refused>

picca avatar Sep 06 '17 14:09 picca

Did you create the testimages archive?

Tests on MPA are new, then maybe i also did it wrong somewhere.

vallsv avatar Sep 06 '17 15:09 vallsv

No , there is no test images in the pip sources. And this is now the upstream sources for python packages

picca avatar Sep 06 '17 16:09 picca

All our tests are based on a butch of files provided by our www.silx.org. We provide a way to test an archive for offline testing. But i push a patch else the script is broken https://github.com/silx-kit/fabio/pull/155. You can generate it like that.

rm -rf build testimages all_testimages.json
python setup.py build test testimages
ls dist -al
-rw-r--r--  1 valls valls 257730382 Sep  7 14:31 fabio-testimages.tar.gz

I don't think it is a good idea to skip resources, while all our tests are based on this resources. If you don't have it, you don't test the library.

vallsv avatar Sep 07 '17 12:09 vallsv

I agreed bu the size of this file is so big that I prefer not to upload this each time in Debian... Maybe we could have a dedicated package for all the data required by the silx project.

What is possible is to run the ets with network in the ci of debian. Because it is possible to run with network on ci.Debian.net.

For now, I unactivated the test during the build.

picca avatar Sep 07 '17 12:09 picca

Do you still need tools to build the tarball with all images ? Since we moved to Meson, this tool would need to be re-written (outside setup.py)

kif avatar Dec 08 '22 16:12 kif