mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 23:09:21 +01:00
Merge pull request #672 from efiop/master
metrics: don't forget to checkout()
This commit is contained in:
@@ -309,11 +309,13 @@ class Project(object):
|
||||
saved = self.scm.active_branch()
|
||||
for branch in self.scm.list_branches():
|
||||
self.scm.checkout(branch)
|
||||
self.checkout()
|
||||
res[branch] = self._read_metric(path,
|
||||
json_path=json_path,
|
||||
tsv_path=tsv_path,
|
||||
htsv_path=htsv_path)
|
||||
self.scm.checkout(saved)
|
||||
self.checkout()
|
||||
return res
|
||||
|
||||
def graph(self):
|
||||
|
||||
@@ -4,6 +4,7 @@ import json
|
||||
from dvc.main import main
|
||||
from tests.basic_env import TestDvc
|
||||
|
||||
|
||||
class TestMetrics(TestDvc):
|
||||
def setUp(self):
|
||||
super(TestMetrics, self).setUp()
|
||||
@@ -57,9 +58,14 @@ class TestMetrics(TestDvc):
|
||||
self.assertTrue(ret['bar'] == ['bar'])
|
||||
self.assertTrue(ret['baz'] == ['baz'])
|
||||
|
||||
def test_cli(self):
|
||||
|
||||
class TestMetricsCLI(TestMetrics):
|
||||
def test(self):
|
||||
#FIXME enable on windows
|
||||
if os.name == 'nt':
|
||||
return
|
||||
#FIXME check output
|
||||
ret = main(['metrics', 'metric'])
|
||||
ret = main(['metrics', 'metric', '-v'])
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
ret = main(['metrics', 'metric_json', '--json-path', 'branch'])
|
||||
|
||||
Reference in New Issue
Block a user