Skip to content

Commit

Permalink
(fixes #1209) do not try to remove remote after dbt init
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed Jan 4, 2019
1 parent 769a886 commit 5826bc8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
1 change: 0 additions & 1 deletion dbt/task/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def clone_starter_repo(self, project_name):
dbt.clients.git.clone(
STARTER_REPO, '.', project_name,
remove_git_dir=True)
dbt.clients.git.remove_remote(project_name)

def create_profiles_dir(self, profiles_dir):
if not os.path.exists(profiles_dir):
Expand Down
37 changes: 37 additions & 0 deletions test/integration/040_init_test/test_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

from test.integration.base import DBTIntegrationTest, use_profile
import os
import shutil


class TestInit(DBTIntegrationTest):
def tearDown(self):
project_name = self.get_project_name()

if os.path.exists(project_name):
shutil.rmtree(project_name)

DBTIntegrationTest.tearDown(self)

def get_project_name(self):
return "my_project_{}".format(self.unique_schema())

@property
def schema(self):
return "init_040"

@property
def models(self):
return "test/integration/040_init_test/models"

@use_profile('postgres')
def test_init_task(self):
project_name = self.get_project_name()
self.run_dbt(['init', project_name])

dir_exists = os.path.exists(project_name)
project_file = os.path.join(project_name, 'dbt_project.yml')
project_file_exists = os.path.exists(project_file)

self.assertTrue(dir_exists)
self.assertTrue(project_file_exists)

0 comments on commit 5826bc8

Please sign in to comment.