2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2023 Marcel Telka
16 %patch% 02-requirements-path.patch
17 %patch% 06-remove-test-reqs.patch
20 # This project does not support tox so we need to provide test requirements
22 TEST_REQUIREMENTS += requirements/test.in
25 # Tests are run from build directory that contains cloned copy of sdist. We
26 # try to ask Python to find tested modules in the proto area (the PYTHONPATH is
27 # set accordingly), but Python (< 3.11) always adds the current directory to
28 # sys.path and there is no known (simple) way how to avoid that. Except -I,
29 # but that would cause Python to ignore PYTHONPATH too so we would not have
30 # access to the proto area either. The -P option together with PYTHONSAFEPATH
31 # environment variable were added to Python 3.11 only so we cannot use them yet
32 # for all Python versions we support.
34 # Since sdist for this project contains the main module in the top-level
35 # directory we cannot force Python to skip it. But, unfortunately, this module
36 # does not contain built dynamic libraries, so Python cannot find them while
39 # To workaround this we rename the main module in the build directory during
40 # testing so Python will need to defer to PYTHONPATH.
42 COMPONENT_PRE_TEST_ACTION += $(MV) $(@D)/aiohttp $(@D)/aiohttp-RENAMED ;
43 COMPONENT_POST_TEST_ACTION += $(MV) $(@D)/aiohttp-RENAMED $(@D)/aiohttp ;
45 # We need to ignore tests in test_proxy_functional.py because we do not have
46 # the proxy.py Python project packaged yet.
47 PYTEST_ADDOPTS += --ignore tests/test_proxy_functional.py
48 # We have no python-on-whales packaged yet.
49 PYTEST_ADDOPTS += --ignore tests/autobahn/test_autobahn.py
50 # We have no pytest_codspeed packaged yet so we cannot run benchmark tests.
51 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_cookiejar.py
52 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_client_request.py
53 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_http_writer.py
54 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_http_websocket.py
55 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_client.py
56 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_client_ws.py
57 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_web_middleware.py
58 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_web_response.py
59 PYTEST_ADDOPTS += --ignore tests/test_benchmarks_web_urldispatcher.py
61 # Random directory name
62 COMPONENT_TEST_TRANSFORMS += "-e 's|/tmp/.*/garbage[^/]*|\$$(TMPDIR)|'"