Exemple #1
0
    def test(self):
        if not _should_test_gcp():
            return

        #FIXME enable
        if os.getenv('CI'):
            return

        key = str(uuid.uuid4()) + '/' + self.FOO
        path = 'gs://' + TEST_GCP_REPO_BUCKET + '/' + key

        client = gc.Client()
        bucket = client.bucket(TEST_GCP_REPO_BUCKET)

        bucket.blob(key).upload_from_filename(self.FOO)

        stage = self.dvc.run(outs=[self.FOO],
                             deps=[path],
                             cmd='gsutil cp {} {}'.format(path, self.FOO))

        bucket.blob(key).upload_from_filename(self.BAR)

        stages = self.dvc.reproduce(stage.path)

        self.assertEqual(len(stages), 1)
        self.assertTrue(filecmp.cmp(self.FOO, self.BAR))
Exemple #2
0
 def should_test(self):
     return _should_test_gcp()
Exemple #3
0
 def should_test(self):
     #FIXME enable
     if os.getenv('CI'):
         return False
     return _should_test_gcp()