From f5ef25644710059d0d529f3bf4d07ae3f72b9e06 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sat, 7 Apr 2018 05:09:45 +0300 Subject: [PATCH] test: don't forget to copy gcp credentials Signed-off-by: Ruslan Kuprieiev --- tests/test_data_cloud.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_data_cloud.py b/tests/test_data_cloud.py index d6a6aa8d0..898cdad44 100644 --- a/tests/test_data_cloud.py +++ b/tests/test_data_cloud.py @@ -41,7 +41,11 @@ def should_test_gcp(): if os.getenv("DVC_TEST_GCP") == "true": return True - if os.getenv("GOOGLE_APPLICATION_CREDENTIALS") and os.getenv("GCP_CREDS"): + creds = os.getenv("GOOGLE_APPLICATION_CREDENTIALS") + if creds and os.getenv("GCP_CREDS"): + if os.path.exists(creds): + os.unlink(creds) + shutil.copyfile(self.GCP_CREDS_FILE, creds) return True return False @@ -182,9 +186,6 @@ class TestDataCloudGCP(TestDataCloudBase): if not should_test_gcp(): return - if os.getenv("GOOGLE_APPLICATION_CREDENTIALS") and os.getenv("GCP_CREDS"): - shutil.copyfile(self.GCP_CREDS_FILE, os.getenv("GOOGLE_APPLICATION_CREDENTIALS")) - repo = get_gcp_url() # Setup cloud