From 344e8cfefc77848aaaa75c39930e6afb95176077 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Feb 2025 17:06:58 +0100 Subject: [PATCH 1/3] GHA/macos: try enabling pytest dump test configs (copy test from GHA/linux) GHA/macos: install caddy GHA/macos: adjust packages ``` ../../tests/http/conftest.py:112: AssertionError _________ ERROR at setup of TestShutdown.test_19_06_check_shutdown[h3] _________ env = httpd = @pytest.fixture(scope='package') def nghttpx(env, httpd) -> Generator[Nghttpx, None, None]: nghttpx = NghttpxQuic(env=env) if nghttpx.exists() and (env.have_h3() or nghttpx.https_port > 0): nghttpx.clear_logs() > assert nghttpx.start() E assert False E + where False = start() E + where start = .start ../../tests/http/conftest.py:112: AssertionError =================================== FAILURES =================================== ___________________ TestDownload.test_02_20_h2_small_frames ____________________ self = env = httpd = @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") def test_02_20_h2_small_frames(self, env: Env, httpd): # Test case to reproduce content corruption as observed in # https://github.com/curl/curl/issues/10525 # To reliably reproduce, we need an Apache httpd that supports # setting smaller frame sizes. This is not released yet, we # test if it works and back out if not. httpd.set_extra_config(env.domain1, lines=[ 'H2MaxDataFrameLen 1024', ]) assert httpd.stop() if not httpd.start(): # no, not supported, bail out httpd.set_extra_config(env.domain1, lines=None) assert httpd.start() pytest.skip('H2MaxDataFrameLen not supported') # ok, make 100 downloads with 2 parallel running and they # are expected to stumble into the issue when using `lib/http2.c` # from curl 7.88.0 count = 5 urln = f'https://{env.authority_for(env.domain1, "h2")}/data-1m?[0-{count-1}]' curl = CurlClient(env=env) r = curl.http_download(urls=[urln], alpn_proto="h2", extra_args=[ '--parallel', '--parallel-max', '2' ]) r.check_response(count=count, http_status=200) srcfile = os.path.join(httpd.docs_dir, 'data-1m') self.check_downloads(curl, srcfile, count) # restore httpd defaults httpd.set_extra_config(env.domain1, lines=None) assert httpd.stop() > assert httpd.start() E assert False E + where False = start() E + where start = .start ../../tests/http/test_02_download.py:314: AssertionError ------------------------------ Captured log call ------------------------------- WARNING testenv.curl:curl.py:807 Timeout at 2025-02-27 19:28:37.390762 after 5.020378s (configured 5.0s): ['/Users/runner/work/curl/curl/bld/tests/../src/curl', '-s', '--path-as-is', '-D', '/Users/runner/work/curl/curl/tests/http/gen/apache/tmp/curl.headers', '-v', '--trace-ids', '--trace-time', '--resolve', 'one.http.curl.se:54349:127.0.0.1', 'http://one.http.curl.se:54349/'] DEBUG testenv.httpd:httpd.py:202 Server still not responding after 0:00:05 =========================== short test summary info ============================ FAILED ../../tests/http/test_02_download.py::TestDownload::test_02_20_h2_small_frames - assert False + where False = start() + where start = .start ERROR ../../tests/http/test_01_basic.py::TestBasic::test_01_01_http_get - assert False + where False = start() + where start = .start ERROR ../../tests/http/test_01_basic.py::TestBasic::test_01_02_https_get - assert False + where False = start() + where start = .start ``` https://github.com/curl/curl/actions/runs/13574254632/job/37946552072?pr=16507 GHA/macos: unlink openssl only for libressl jobs 5c07439ba3345cef3eb158a8b2b8064cc246199a #11436 GHA/macos: unlink openssl only for libressl jobs fixup GHA/macos: debug httpd 1 GHA/macos: start services GHA/macos: pytest cleanup GHA/macos: pytest verbose --- .github/workflows/macos.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9dbe4ea718..526ce71a0a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -139,6 +139,7 @@ jobs: chkprefill: _chkprefill - name: 'quictls +static libssh +examples' install: quictls libssh + install_steps: pytest generate: -DOPENSSL_ROOT_DIR=$(brew --prefix quictls) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON - name: 'SecureTransport debug' generate: -DCURL_USE_SECTRANSP=ON -DENABLE_DEBUG=ON @@ -186,6 +187,7 @@ jobs: echo ${{ matrix.build.generate && 'ninja' || 'automake libtool' }} \ pkgconf libpsl libssh2 \ ${{ !matrix.build.clang-tidy && 'libnghttp2 stunnel' || '' }} \ + ${{ contains(matrix.build.install_steps, 'pytest') && 'caddy httpd vsftpd' || '' }} \ ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done @@ -270,6 +272,9 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'test configs' + run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true + - name: 'build-cert' if: contains(matrix.build.generate, '-DCURL_USE_SECTRANSP=ON') || contains(matrix.build.configure, '--with-secure-transport') run: | @@ -341,6 +346,28 @@ jobs: make -C bld V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} fi + - name: 'install pytest prereqs' + if: ${{ !matrix.build.clang-tidy && contains(matrix.build.install_steps, 'pytest') }} + run: | + source $HOME/venv/bin/activate + python3 -m pip install -r tests/http/requirements.txt + + - name: 'run pytest' + if: ${{ !matrix.build.clang-tidy && contains(matrix.build.install_steps, 'pytest') }} + env: + CURL_CI: github + PYTEST_ADDOPTS: '--color=yes --verbose' + run: | + brew services start caddy + brew services start httpd + brew services start vsftpd + source $HOME/venv/bin/activate + if [ -n '${{ matrix.build.generate }}' ]; then + cmake --build bld --verbose --target curl-pytest-ci + else + make -C bld V=1 pytest-ci + fi + - name: 'build examples' if: ${{ contains(matrix.build.name, '+examples') }} run: | From c5793aa13a4d5a6346da4f5c51286d278d3117cc Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Feb 2025 03:59:39 +0100 Subject: [PATCH 2/3] GHA/macos: cleanups --- .github/workflows/macos.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 526ce71a0a..87b8b9d31f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -356,11 +356,9 @@ jobs: if: ${{ !matrix.build.clang-tidy && contains(matrix.build.install_steps, 'pytest') }} env: CURL_CI: github - PYTEST_ADDOPTS: '--color=yes --verbose' + PYTEST_ADDOPTS: '--color=yes' run: | - brew services start caddy brew services start httpd - brew services start vsftpd source $HOME/venv/bin/activate if [ -n '${{ matrix.build.generate }}' ]; then cmake --build bld --verbose --target curl-pytest-ci From bdb6a461345bb89fd191c66a2a3c6063ce43bf18 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 28 Feb 2025 04:16:52 +0100 Subject: [PATCH 3/3] GHA/macos: cleanups more --- .github/workflows/macos.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 87b8b9d31f..823df88dc9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -358,7 +358,6 @@ jobs: CURL_CI: github PYTEST_ADDOPTS: '--color=yes' run: | - brew services start httpd source $HOME/venv/bin/activate if [ -n '${{ matrix.build.generate }}' ]; then cmake --build bld --verbose --target curl-pytest-ci