Skip to content

Commit

Permalink
bench: drop bench_datachain fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Oct 29, 2024
1 parent 410b570 commit 6f86e5d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def bench(session: nox.Session) -> None:
session.install(".[tests]")
session.run(
"pytest",
"-m",
"benchmark",
"--benchmark-only",
"--benchmark-group-by",
"func",
*session.posargs,
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ namespaces = false
[tool.setuptools_scm]

[tool.pytest.ini_options]
addopts = "-rfEs -m 'not benchmark and not examples'"
addopts = "-rfEs -m 'not examples' --benchmark-skip"
markers = [
"benchmark: benchmarks.",
"e2e: End-to-end tests",
"examples: All examples",
"computer_vision: Computer vision examples",
Expand Down
5 changes: 0 additions & 5 deletions tests/benchmarks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
import pytest


@pytest.fixture
def bucket():
return "s3://noaa-bathymetry-pds/"


@pytest.fixture
def datasets():
return Path(__file__).parent / "datasets"
3 changes: 0 additions & 3 deletions tests/benchmarks/test_datachain.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import pytest

from datachain.lib.dc import DataChain
from datachain.lib.webdataset_laion import process_laion_meta


@pytest.mark.benchmark
def test_datachain(tmp_dir, test_session, datasets, benchmark):
def run_script(uri, **kwargs):
DataChain.from_storage(uri, session=test_session, **kwargs).gen(
Expand Down
8 changes: 6 additions & 2 deletions tests/benchmarks/test_ls.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
def test_ls(benchmark, tmp_dir, bucket):
benchmark("ls", bucket, "--anon")
from datachain.cli import ls


def test_ls(benchmark, tmp_dir):
bucket = "s3://noaa-bathymetry-pds/"
benchmark.pedantic(ls, args=([bucket],), kwargs={"client_config": {"anon": True}})
7 changes: 6 additions & 1 deletion tests/benchmarks/test_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
import shutil
import subprocess


def test_version(benchmark):
benchmark("--help", rounds=100)
bin = shutil.which("datachain")
benchmark(subprocess.check_call, [bin, "--help"])

0 comments on commit 6f86e5d

Please sign in to comment.