icing / mod_h2

HTTP/2 module for Apache httpd
https://icing.github.io/mod_h2/
Apache License 2.0
256 stars 41 forks source link

Distribute .py files needed by the test suite #276

Open uhliarik opened 9 months ago

uhliarik commented 9 months ago

Hello Stefan,

during test suite setup I came across some issues.

1) without having conftest.py, I was getting many errors like:

      def test_h2_711_12(self, env, repeat):
E       fixture 'repeat' not found
>       available fixtures: __pytest_repeat_step_number, _class_scope, _session_scope, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, env, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/tmp/tmp.6rABq4Ca9P/BUILD/mod_http2-2.0.26/test/modules/http2/test_711_load_post_cgi.py:60

2) It would be good to mention in README.md, that also following python3 modules are needed by mod_http2's TS:

pip3 install cryptography pytest-repeat websockets python-multipart

3) I saw that load_test.py is also reachable by Makefile, so it might be a good idea to include it as well?

uhliarik commented 9 months ago

Apart from that, I'm getting 3 more errors when running TS on the latest 2.0.26:

=================================== FAILURES ===================================
_________________________ TestProxy.test_h2_500_31[0] __________________________

self = <http2.test_500_proxy.TestProxy object at 0x7f0ac314d790>
env = <http2.env.H2TestEnv object at 0x7f0ac3023160>, repeat = 0

    def test_h2_500_31(self, env, repeat):
        url = env.mkurl("https", "cgi", "/proxy/h2test/error?body_error=timeout")
        r = env.curl_get(url)
>       assert r.exit_code != 0, r
E       AssertionError: ExecResult[code=0, args=['curl', '-s', '--path-as-is', '-D', '/tmp/tmp.GIEiTmNJQA/BUILD/mod_http2-2.0.26/test/pyhttpd/...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX----stderr---------------------------------------
E         
E       assert 0 != 0
E        +  where 0 = ExecResult[code=0, args=['curl', '-s', '--path-as-is', '-D', '/tmp/tmp.GIEiTmNJQA/BUILD/mod_http2-2.0.26/test/pyhttpd/...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX----stderr---------------------------------------\n.exit_code

modules/http2/test_500_proxy.py:151: AssertionError
---------------------------- Captured stdout setup -----------------------------
setup_method: test_h2_500_31
--------------------------- Captured stdout teardown ---------------------------
teardown_method: test_h2_500_31
_________________________ TestProxy.test_h2_500_32[0] __________________________

self = <http2.test_500_proxy.TestProxy object at 0x7f0ac314d580>
env = <http2.env.H2TestEnv object at 0x7f0ac3023160>, repeat = 0

    def test_h2_500_32(self, env, repeat):
        url = env.mkurl("https", "cgi", "/proxy/h2test/error?body_error=timeout&error_bucket=0")
        r = env.curl_get(url)
>       assert r.exit_code != 0, r
E       AssertionError: ExecResult[code=0, args=['curl', '-s', '--path-as-is', '-D', '/tmp/tmp.GIEiTmNJQA/BUILD/mod_http2-2.0.26/test/pyhttpd/...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX----stderr---------------------------------------
E         
E       assert 0 != 0
E        +  where 0 = ExecResult[code=0, args=['curl', '-s', '--path-as-is', '-D', '/tmp/tmp.GIEiTmNJQA/BUILD/mod_http2-2.0.26/test/pyhttpd/...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX----stderr---------------------------------------\n.exit_code

modules/http2/test_500_proxy.py:157: AssertionError
---------------------------- Captured stdout setup -----------------------------
setup_method: test_h2_500_32
--------------------------- Captured stdout teardown ---------------------------
teardown_method: test_h2_500_32
________________________ TestH2Proxy.test_h2_600_31[0] _________________________

self = <http2.test_600_h2proxy.TestH2Proxy object at 0x7f0ac3075af0>
env = <http2.env.H2TestEnv object at 0x7f0ac3023160>, repeat = 0

    def test_h2_600_31(self, env, repeat):
        conf = H2Conf(env)
        conf.add_vhost_cgi(h2proxy_self=True)
        conf.install()
        assert env.apache_restart() == 0
        url = env.mkurl("https", "cgi", "/h2proxy/h2test/error?body_error=timeout")
        r = env.curl_get(url)
        # depending on when the error is detect in proxying, if may RST the
        # stream (exit_code != 0) or give a 503 response.
        if r.exit_code == 0:
>           assert r.response['status'] == 502
E           assert 200 == 502

modules/http2/test_600_h2proxy.py:187: AssertionError
=========================== short test summary info ============================

In case you can recognize some of the errors above or you know what could cause these errors, it would be helpful to share the info with me. In case you don't have any idea, I can continue with investigation but so far I haven't found the root of the problem :-( . Maybe I'm missing some other library/script...

Thanks in advance.