]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: rename tests/tests-httpd to tests/http
authorStefan Eissing <stefan@eissing.org>
Wed, 1 Mar 2023 15:55:31 +0000 (16:55 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 2 Mar 2023 13:05:19 +0000 (14:05 +0100)
 - httpd is only one server we test with
 - the suite coveres the HTTP protocol in general where
   the default test cases need a more beefy environment

Closes #10654

30 files changed:
.github/labeler.yml
configure.ac
tests/Makefile.am
tests/conftest.py [new file with mode: 0644]
tests/http/.gitignore [moved from tests/tests-httpd/.gitignore with 100% similarity]
tests/http/Makefile.am [moved from tests/tests-httpd/Makefile.am with 100% similarity]
tests/http/README.md [moved from tests/tests-httpd/README.md with 95% similarity]
tests/http/config.ini.in [moved from tests/tests-httpd/config.ini.in with 100% similarity]
tests/http/conftest.py [moved from tests/tests-httpd/conftest.py with 81% similarity]
tests/http/scorecard.py [moved from tests/tests-httpd/scorecard.py with 100% similarity]
tests/http/test_01_basic.py [moved from tests/tests-httpd/test_01_basic.py with 100% similarity]
tests/http/test_02_download.py [moved from tests/tests-httpd/test_02_download.py with 100% similarity]
tests/http/test_03_goaway.py [moved from tests/tests-httpd/test_03_goaway.py with 100% similarity]
tests/http/test_04_stuttered.py [moved from tests/tests-httpd/test_04_stuttered.py with 100% similarity]
tests/http/test_05_errors.py [moved from tests/tests-httpd/test_05_errors.py with 100% similarity]
tests/http/test_06_eyeballs.py [moved from tests/tests-httpd/test_06_eyeballs.py with 100% similarity]
tests/http/test_07_upload.py [moved from tests/tests-httpd/test_07_upload.py with 100% similarity]
tests/http/test_08_caddy.py [moved from tests/tests-httpd/test_08_caddy.py with 100% similarity]
tests/http/test_09_push.py [moved from tests/tests-httpd/test_09_push.py with 100% similarity]
tests/http/test_10_proxy.py [moved from tests/tests-httpd/test_10_proxy.py with 100% similarity]
tests/http/test_11_unix.py [moved from tests/tests-httpd/test_11_unix.py with 100% similarity]
tests/http/testenv/__init__.py [moved from tests/tests-httpd/testenv/__init__.py with 100% similarity]
tests/http/testenv/caddy.py [moved from tests/tests-httpd/testenv/caddy.py with 100% similarity]
tests/http/testenv/certs.py [moved from tests/tests-httpd/testenv/certs.py with 100% similarity]
tests/http/testenv/curl.py [moved from tests/tests-httpd/testenv/curl.py with 100% similarity]
tests/http/testenv/env.py [moved from tests/tests-httpd/testenv/env.py with 99% similarity]
tests/http/testenv/httpd.py [moved from tests/tests-httpd/testenv/httpd.py with 100% similarity]
tests/http/testenv/mod_curltest/.gitignore [moved from tests/tests-httpd/testenv/mod_curltest/.gitignore with 100% similarity]
tests/http/testenv/mod_curltest/mod_curltest.c [moved from tests/tests-httpd/testenv/mod_curltest/mod_curltest.c with 100% similarity]
tests/http/testenv/nghttpx.py [moved from tests/tests-httpd/testenv/nghttpx.py with 100% similarity]

index 025ab952f1669e0723c71a920a0a465ec491341f..4ae38c438c772686124b6760270b7a010f8deecf 100644 (file)
@@ -157,7 +157,7 @@ HTTP:
 - all: ['lib/h2h3.*']
 - all: ['lib/http*']
 - all: ['tests/http-server.pl']
-- all: ['tests/tests-httpd/*']
+- all: ['tests/http/*']
 
 HTTP/2:
 - all: ['docs/HTTP2.md']
index 4edc33e2315ee4db27f55eb081c5de7041415f71..276c78474b978b00d21cfa6bbf8bafefbf5deb67 100644 (file)
@@ -4654,8 +4654,8 @@ AC_CONFIG_FILES([Makefile \
            tests/server/Makefile \
            tests/libtest/Makefile \
            tests/unit/Makefile \
-           tests/tests-httpd/config.ini \
-           tests/tests-httpd/Makefile \
+           tests/http/config.ini \
+           tests/http/Makefile \
            packages/Makefile \
            packages/vms/Makefile \
            curl-config \
index bc129326d0b8a12dffbe9b767db38846466e3fe4..51a26d1e6ac0ec4d12d0c86adbac8a32a83585a3 100644 (file)
@@ -48,7 +48,7 @@ BUILD_UNIT =
 DIST_UNIT = unit
 endif
 
-SUBDIRS = certs data server libtest tests-httpd $(BUILD_UNIT)
+SUBDIRS = certs data server libtest http $(BUILD_UNIT)
 DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT)
 
 PERLFLAGS = -I$(srcdir)
diff --git a/tests/conftest.py b/tests/conftest.py
new file mode 100644 (file)
index 0000000..3e0599c
--- /dev/null
@@ -0,0 +1,48 @@
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 2008 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at https://curl.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+# SPDX-License-Identifier: curl
+#
+###########################################################################
+#
+import logging
+import os
+import sys
+from typing import Optional
+
+import pytest
+
+
+def pytest_report_header(config, startdir):
+    return f"curl tests"
+
+
+def pytest_addoption(parser):
+    parser.addoption("--repeat", action="store", type=int, default=1,
+                     help='Number of times to repeat each test')
+
+
+def pytest_generate_tests(metafunc):
+    if "repeat" in metafunc.fixturenames:
+        count = int(metafunc.config.getoption("repeat"))
+        metafunc.fixturenames.append('tmp_ct')
+        metafunc.parametrize('repeat', range(count))
+
+
similarity index 95%
rename from tests/tests-httpd/README.md
rename to tests/http/README.md
index cf02b50aaf6bfafd092f6087ea46328c298a8e7f..e7069d6223399dc0d3c830f7d7b1b7abfba6a359 100644 (file)
@@ -59,22 +59,22 @@ curl> pytest -k "test_02_06 and h2"
 Several test cases can be repeated, they all have the `repeat` parameter. To make this work, you have to start `pytest` in the test directory itself (for some unknown reason). Like in:
 
 ```
-curl/tests/tests-httpd> pytest -k "test_02_06 and h2" --repeat=100
+curl/tests/http> pytest -k "test_02_06 and h2" --repeat=100
 ```
 
 which then runs this test case a hundred times. In case of flaky tests, you can make pytest stop on the first one with:
 
 ```
-curl/tests/tests-httpd> pytest -k "test_02_06 and h2" --repeat=100 --maxfail=1
+curl/tests/http> pytest -k "test_02_06 and h2" --repeat=100 --maxfail=1
 ```
 
 which allow you to inspect output and log files for the failed run. Speaking of log files, the verbosity of pytest is also used to collect curl trace output. If you specify `-v` three times, the `curl` command is started with `--trace`:
 
 ```
-curl/tests/tests-httpd> pytest -vvv -k "test_02_06 and h2" --repeat=100 --maxfail=1
+curl/tests/http> pytest -vvv -k "test_02_06 and h2" --repeat=100 --maxfail=1
 ```
 
-all of curl's output and trace file are found in `tests/tests-httpd/gen/curl`.
+all of curl's output and trace file are found in `tests/http/gen/curl`.
 
 ## Writing Tests
 
similarity index 81%
rename from tests/tests-httpd/conftest.py
rename to tests/http/conftest.py
index 3679eabbb7130de588bd5934be70a5cc2fd6f209..903c6c87b12129d317883f45207c78fa14cf360c 100644 (file)
@@ -35,19 +35,7 @@ from testenv import Env, Nghttpx, Httpd
 
 
 def pytest_report_header(config, startdir):
-    return f"curl tests-httpd tests"
-
-
-def pytest_addoption(parser):
-    parser.addoption("--repeat", action="store", type=int, default=1,
-                     help='Number of times to repeat each test')
-
-
-def pytest_generate_tests(metafunc):
-    if "repeat" in metafunc.fixturenames:
-        count = int(metafunc.config.getoption("repeat"))
-        metafunc.fixturenames.append('tmp_ct')
-        metafunc.parametrize('repeat', range(count))
+    return f"curl http tests"
 
 
 @pytest.fixture(scope="package")
similarity index 99%
rename from tests/tests-httpd/testenv/env.py
rename to tests/http/testenv/env.py
index f468043dd8524c4fdabe0b2c3be9c665eed7b6ae..8389119a7dfee8afdf64a958c1ed7dead566f698 100644 (file)
@@ -112,7 +112,7 @@ class EnvConfig:
             'cert': 'xxx',
         }
         self.htdocs_dir = os.path.join(self.gen_dir, 'htdocs')
-        self.tld = 'tests-httpd.curl.se'
+        self.tld = 'http.curl.se'
         self.domain1 = f"one.{self.tld}"
         self.domain2 = f"two.{self.tld}"
         self.proxy_domain = f"proxy.{self.tld}"