Add tests for different Postgres client libraries (#2008)

* Add tests for different postgres clients
* test/fixtures: sanitize test name for test_output_dir
* test/fixtures: do not look for etcd before runtime
* Add workflow for testing Postgres client libraries
This commit is contained in:
Alexander Bayandin
2022-07-05 12:22:58 +01:00
committed by GitHub
parent 844832ffe4
commit 05f6a1394d
31 changed files with 712 additions and 2 deletions

View File

@@ -1925,9 +1925,12 @@ class Etcd:
datadir: str
port: int
peer_port: int
binary_path: Path = etcd_path()
binary_path: Path = field(init=False)
handle: Optional[subprocess.Popen[Any]] = None # handle of running daemon
def __post_init__(self):
self.binary_path = etcd_path()
def client_url(self):
return f'http://127.0.0.1:{self.port}'
@@ -1984,7 +1987,7 @@ class Etcd:
def get_test_output_dir(request: Any) -> pathlib.Path:
""" Compute the working directory for an individual test. """
test_name = request.node.name
test_dir = pathlib.Path(top_output_dir) / test_name
test_dir = pathlib.Path(top_output_dir) / test_name.replace("/", "-")
log.info(f'get_test_output_dir is {test_dir}')
# make mypy happy
assert isinstance(test_dir, pathlib.Path)