[Bug 2053267] Re: Run test-suite as part of autopkgtest

Olivier Gayot 2053267 at bugs.launchpad.net
Thu Feb 15 19:23:22 UTC 2024


Excerpt of autopkgtest output when the test-suite fails (I intentially
broke one of the test)

=== python3.12 ===
============================= test session starts ==============================
platform linux -- Python 3.12.2, pytest-7.4.4, pluggy-1.3.0 -- /usr/bin/python3.12
cachedir: .pytest_cache
rootdir: /tmp/autopkgtest.B0Xt86/autopkgtest_tmp
collecting ... collected 5 items

tests/test_requests_unixsocket.py::test_unix_domain_adapter_ok PASSED    [ 20%]
tests/test_requests_unixsocket.py::test_unix_domain_adapter_url_with_query_params PASSED [ 40%]
tests/test_requests_unixsocket.py::test_unix_domain_adapter_connection_error PASSED [ 60%]
tests/test_requests_unixsocket.py::test_unix_domain_adapter_connection_proxies_error PASSED [ 80%]
tests/test_requests_unixsocket.py::test_unix_domain_adapter_monkeypatch FAILED [100%]

=================================== FAILURES ===================================
_____________________ test_unix_domain_adapter_monkeypatch _____________________

    def test_unix_domain_adapter_monkeypatch():
        with UnixSocketServerThread() as usock_thread:
            with requests_unixsocket.monkeypatch('http+unix://'):
                urlencoded_usock = requests.compat.quote_plus(usock_thread.usock)
                url = 'http+unix://%s/path/to/page' % urlencoded_usock
    
                for method in ['get', 'post', 'head', 'patch', 'put', 'delete',
                               'options']:
                    logger.debug('Calling session.%s(%r) ...', method, url)
                    r = getattr(requests, method)(url)
                    logger.debug(
                        'Received response: %r with text: %r and headers: %r',
                        r, r.text, r.headers)
                    assert r.status_code == 200
                    assert r.headers['server'] == 'waitress'
                    assert r.headers['X-Transport'] == 'unix domain socket'
                    assert r.headers['X-Requested-Path'] == '/path/to/page'
                    assert r.headers['X-Socket-Path'] == usock_thread.usock
                    assert isinstance(r.connection,
                                      requests_unixsocket.UnixAdapter)
                    assert r.url.lower() == url.lower()
                    if method == 'head':
                        assert r.text == ''
                    else:
>                       assert r.text == 'Hewllo world!'
E                       AssertionError: assert 'Hello world!' == 'Hewllo world!'
E                         - Hewllo world!
E                         ?   -
E                         + Hello world!

tests/test_requests_unixsocket.py:117: AssertionError
=========================== short test summary info ============================
FAILED tests/test_requests_unixsocket.py::test_unix_domain_adapter_monkeypatch
========================= 1 failed, 4 passed in 0.12s ==========================
autopkgtest [20:08:18]: test python3-requests-unixsocket: -----------------------]
autopkgtest [20:08:18]: test python3-requests-unixsocket:  - - - - - - - - - - results - - - - - - - - - -
python3-requests-unixsocket FAIL non-zero exit status 1
autopkgtest [20:08:18]: @@@@@@@@@@@@@@@@@@@@ summary
python3-requests-unixsocket FAIL non-zero exit status 1

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-requests-unixsocket in Ubuntu.
https://bugs.launchpad.net/bugs/2053267

Title:
  Run test-suite as part of autopkgtest

Status in python-requests-unixsocket package in Ubuntu:
  New

Bug description:
  python-requests-unixsocket does not declare any autopkgtest. autodep8
  detects that it is a python package and therefore runs
  autodep8-python3 which does the following:

  ```python3
  import requests_unixsocket
  print(requests_unixsocket)
  ```

  This is better than nothing but running the actual test-suite would be
  much better. This could have prevented bugs like
  https://bugs.launchpad.net/ubuntu/+source/python-requests-
  unixsocket/+bug/2053016 by blocking urllib3 / src:requests migration.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-requests-unixsocket/+bug/2053267/+subscriptions




More information about the Ubuntu-openstack-bugs mailing list