MCPcopy
hub / github.com/treeverse/dvc / test_partial_add

Function test_partial_add

dvc/testing/benchmarks/cli/stories/test_modify_data.py:15–34  ·  view source on GitHub ↗
(bench_dvc, tmp_dir, dvc, dataset, remote)

Source from the content-addressed store, hash-verified

13
14@pytest.mark.skipif(sys.version_info < (3, 10), reason="requires 3.10 glob.glob")
15def test_partial_add(bench_dvc, tmp_dir, dvc, dataset, remote):
16 random.seed(4231)
17 # Move some files to create a partial dataset
18 os.makedirs("partial-copy")
19 for f in glob.glob("*", root_dir=dataset, recursive=True): # type: ignore[call-arg]
20 if random.random() > 0.5: # noqa: S311
21 shutil.move(dataset / f, tmp_dir / "partial-copy" / f)
22
23 # Add/push partial dataset
24 bench_dvc("add", dataset)
25 bench_dvc("push")
26
27 # Add more files to the dataset
28 shutil.copytree("partial-copy", dataset, dirs_exist_ok=True)
29
30 # Benchmark operations for adding files to a dataset
31 bench_dvc("add", dataset, name="partial")
32 bench_dvc("push", name="partial")
33 bench_dvc("gc", "-f", "-w", name="noop")
34 bench_dvc("gc", "-f", "-w", "-c", name="cloud-noop")
35
36
37@pytest.mark.skipif(sys.version_info < (3, 10), reason="requires 3.10 glob.glob")

Callers

nothing calls this directly

Calls 2

bench_dvcFunction · 0.85
moveMethod · 0.80

Tested by

no test coverage detected