mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-07 21:42:56 +00:00
Change benchmark plugin layout so pytest loads it properly when running
all tests (not necessary performance ones) resolves #837
This commit is contained in:
committed by
Dmitry Rodionov
parent
33007cc0bb
commit
c75bc9b8b0
@@ -1 +1 @@
|
||||
pytest_plugins = ("fixtures.zenith_fixtures")
|
||||
pytest_plugins = ("fixtures.zenith_fixtures", "fixtures.benchmark_fixture")
|
||||
|
||||
@@ -16,7 +16,7 @@ import warnings
|
||||
from contextlib import contextmanager
|
||||
|
||||
# Type-related stuff
|
||||
from typing import Iterator, Optional
|
||||
from typing import Iterator
|
||||
"""
|
||||
This file contains fixtures for micro-benchmarks.
|
||||
|
||||
@@ -314,6 +314,14 @@ def zenbenchmark(record_property) -> Iterator[ZenithBenchmarker]:
|
||||
yield benchmarker
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--out-dir",
|
||||
dest="out_dir",
|
||||
help="Directory to ouput performance tests results to.",
|
||||
)
|
||||
|
||||
|
||||
def get_out_path(target_dir: Path, revision: str) -> Path:
|
||||
"""
|
||||
get output file path
|
||||
|
||||
@@ -12,14 +12,13 @@ import json
|
||||
import psycopg2
|
||||
import pytest
|
||||
import shutil
|
||||
import signal
|
||||
import socket
|
||||
import subprocess
|
||||
import time
|
||||
import filecmp
|
||||
import tempfile
|
||||
|
||||
from contextlib import closing, suppress
|
||||
from contextlib import closing
|
||||
from pathlib import Path
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# pytest some has quirks with discovering plugins, so having it there just works
|
||||
# probably we should create custom plugin and add it to pytest config to always have needed things at hand
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--out-dir",
|
||||
dest="out_dir",
|
||||
help="Directory to ouput performance tests results to.",
|
||||
)
|
||||
Reference in New Issue
Block a user