Skip to content

Commit

Permalink
testing: bench: use --dataset instead of --size (#10134)
Browse files Browse the repository at this point in the history
This is no longer just about size (e.g. we have mnist/openorca/used-cars),
so the --dataset makes more sense.
  • Loading branch information
efiop authored Dec 4, 2023
1 parent c0b64b0 commit e18fd34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dvc/testing/benchmarks/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _make_dataset(

path = tmp_dir / "dataset"
root = dvc_bench_git_repo
src = root / "data" / bench_config.size / "dataset"
src = root / "data" / bench_config.dataset / "dataset"
src_dvc = src.with_suffix(".dvc")

dvc = Repo(root)
Expand Down
12 changes: 6 additions & 6 deletions dvc/testing/benchmarks/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def pytest_report_header(config):
bconf = config.bench_config
return "dvc-bench: (" f"size: '{bconf.size}'," f"revs: '{bconf.dvc_revs}'" ")"
return "dvc-bench: (" f"dataset: '{bconf.dataset}'," f"revs: '{bconf.dvc_revs}'" ")"


def pytest_generate_tests(metafunc):
Expand All @@ -18,7 +18,7 @@ def pytest_generate_tests(metafunc):

class DVCBenchConfig:
def __init__(self):
self.size = "small"
self.dataset = "small"
self.dvc_bin = DEFAULT_DVC_BIN
self.dvc_revs = None
self.dvc_git_repo = DEFAULT_DVC_GIT_REPO
Expand All @@ -34,7 +34,7 @@ def pytest_configure(config):
)

config.bench_config = DVCBenchConfig()
config.bench_config.size = config.getoption("--size")
config.bench_config.dataset = config.getoption("--dataset")
config.bench_config.dvc_bin = config.getoption("--dvc-bin")
config.bench_config.dvc_revs = config.getoption("--dvc-revs")
config.bench_config.dvc_git_repo = config.getoption("--dvc-git-repo")
Expand All @@ -46,10 +46,10 @@ def pytest_configure(config):

def pytest_addoption(parser):
parser.addoption(
"--size",
choices=["tiny", "small", "large", "mnist", "openorca"],
"--dataset",
type=str,
default="small",
help="Size of the dataset/datafile to use in tests",
help="Dataset name to use in tests (e.g. tiny/small/large/mnist/etc)",
)

parser.addoption(
Expand Down

0 comments on commit e18fd34

Please sign in to comment.