mirror of
https://github.com/curl/curl.git
synced 2026-08-05 16:16:14 +03:00
tests: use dynamic ports numbers in pytest suite
- necessary ports are bound at start of test suite and then given to server fixtures for use. - this make parallel use of pytest (in separate directories), practically safe for use as OS tend to not reuse such port numbers for a while Closes #10692
This commit is contained in:
parent
257416023d
commit
b0564c1d54
6 changed files with 118 additions and 39 deletions
|
|
@ -22,16 +22,30 @@
|
|||
#
|
||||
###########################################################################
|
||||
#
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from typing import Optional
|
||||
import sys, os
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), 'http'))
|
||||
|
||||
import pytest
|
||||
|
||||
from testenv import Env
|
||||
|
||||
def pytest_report_header(config, startdir):
|
||||
return f"curl tests"
|
||||
# Env inits its base properties only once, we can report them here
|
||||
env = Env()
|
||||
report = [
|
||||
f'Testing curl {env.curl_version()}',
|
||||
f' httpd: {env.httpd_version()}, http:{env.http_port} https:{env.https_port}',
|
||||
f' httpd-proxy: {env.httpd_version()}, http:{env.proxy_port} https:{env.proxys_port}'
|
||||
]
|
||||
if env.have_h3_server():
|
||||
report.extend([
|
||||
f' nghttpx: {env.nghttpx_version()}, h3:{env.https_port}'
|
||||
])
|
||||
if env.has_caddy():
|
||||
report.extend([
|
||||
f' Caddy: {env.caddy_version()}, http:{env.caddy_http_port} https:{env.caddy_https_port}'
|
||||
])
|
||||
return '\n'.join(report)
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue