Skip to content

Potential bug when testing run with metrics_no_cache #2574

@pared

Description

@pared

In our test base, TestDirFixture.CODE copies src to target. It can cause problem if one decides to write a test like:

dvc_repo.add(repo_dir.FOO)
metric_file = "metric.txt"
dvc_repo.run(
        deps=[repo_dir.FOO],
        metrics_no_cache=[metric_file],
        cmd="python {} {} {}".format(repo_dir.CODE, repo_dir.FOO, metric_file),
    )

In this case metric is not supposed to be in cache. But due to fact that it is identical as repo_dir.FOO it is inside cache, so we might end up "finding" it for example here. Which can lead to some unexpected behaviour.

Currently, there is no test using CODE to create metric, so I would not prioritize this task, though we should do something to discourage or prevent this use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-nice-to-haveIt should be done this or next sprintrefactoringFactoring and re-factoringtestingRelated to the tests and the testing infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions