mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-26 15:28:28 +01:00
* run: add --plot/--plot-no-cache Part of #3409 * plot: move show/diff to API * plots: show marked plots by default Involves some refactoring to make plots comply with the rest of the code base. * dvc.yaml: use top-level metrics and plots * dvc.yaml: add support for plot template * plots: add support for templates in dvc.yaml * dvc.yaml: allow metrics/plots to have persist/cache * plots: render single page by-default and introduce --show-json * plot: use "working tree" instead of "workspace" Just to sync this with the rest of the codebase. We should consider renaming it to "workspace" everywhere, but for now I opt to not touch it to not break something that depends on it. * plots: rename -f|--file to -o|--out Better corresponds to other commands like `import`. * plots: use RepoTree and brancher instead of api * stage: get rid of OutputParams * tests: plots: add simple diff test * plots: use `--targets` instead of `--datafile` Makes it comply with `dvc metrics/params` CLI options. * tests: unit: plots: add --show-json test * stage: cleanup exception for format error Based on feedback from the users. * lockfile: use relpath in corruption error
17 lines
530 B
Python
17 lines
530 B
Python
import pytest
|
|
|
|
from dvc.repo.plots.diff import _revisions
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"arg_revisions,is_dirty,expected_revisions",
|
|
[
|
|
([], False, ["working tree"]),
|
|
([], True, ["HEAD", "working tree"]),
|
|
(["v1", "v2", "working tree"], False, ["v1", "v2", "working tree"]),
|
|
(["v1", "v2", "working tree"], True, ["v1", "v2", "working tree"]),
|
|
],
|
|
)
|
|
def test_revisions(mocker, arg_revisions, is_dirty, expected_revisions):
|
|
assert _revisions(arg_revisions, is_dirty) == expected_revisions
|