Skip to content

Commit e754e52

Browse files
committed
make submodule dir repo name and removed common steps form downloading by default
1 parent 48b4a87 commit e754e52

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Diff for: circle.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ test:
1515
override:
1616
- mkdir test_dir
1717
- cd test_dir && COVERAGE_FILE=../.coverage.init coverage run ../ctf-cli.py init
18+
- cd test_dir && COVAREGE_FILE=../.coverage.remote_add coverage run ../ctf-cli.py remote add steps https://github.com/Containers-Testing-Framework/common-steps.git
1819
- cd test_dir && COVAREGE_FILE=../.coverage.remote_add coverage run ../ctf-cli.py remote add features https://github.com/Containers-Testing-Framework/common-features.git
1920
- cd test_dir && COVERAGE_FILE=../.coverage.update coverage run ../ctf-cli.py update
2021
- cd test_dir && COVERAGE_FILE=../.coverage.run coverage run ../ctf-cli.py run

Diff for: ctf_cli/application.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,6 @@ def init(self):
100100
with open(steps_py_file, "w") as f:
101101
f.write(common_steps_py_content)
102102
check_call("git add %s" % steps_py_file, shell=True)
103-
104-
common_steps_dir = os.path.join(steps_dir, "common_steps")
105-
if os.path.exists(common_steps_dir):
106-
logger.info("Directory tests/steps/common_steps already exists")
107-
else:
108-
logger.info("Adding tests/steps/common_steps as a submodule")
109-
check_call('git submodule add https://github.com/Containers-Testing-Framework/common-steps.git tests/steps/common_steps', shell=True)
110103

111104
# Copy sample configuration
112105
ctf_conf_file = os.path.join(self._execution_dir_path, "ctf.conf")
@@ -128,15 +121,15 @@ def add_remote(self):
128121
def add_remote_feature(self):
129122
project = self._cli_conf.get(CTFCliConfig.GLOBAL_SECTION_NAME, CTFCliConfig.CONFIG_REMOTE_PROJECT)
130123
if project is None:
131-
path = "tests/features/common-remote"
124+
path = "tests/features/"
132125
else:
133126
path = "tests/features/" + project
134127
self.add_submodule(path)
135128

136129
def add_remote_step(self):
137130
project = self._cli_conf.get(CTFCliConfig.GLOBAL_SECTION_NAME, CTFCliConfig.CONFIG_REMOTE_PROJECT)
138131
if project is None:
139-
path = "tests/steps/common-remote"
132+
path = "tests/steps/"
140133
else:
141134
path = "tests/steps/" + project
142135
self.add_submodule(path)
@@ -146,7 +139,8 @@ def list_remotes(self):
146139

147140
def add_submodule(self, path):
148141
url = self._cli_conf.get(CTFCliConfig.GLOBAL_SECTION_NAME, CTFCliConfig.CONFIG_REMOTE_URL)
149-
check_call('git submodule add %s %s' % (url, path), shell=True)
142+
dirname = os.path.splitext(os.path.basename(url))[0]
143+
check_call('git submodule add %s %s' % (url, path + "/" + dirname), shell=True)
150144

151145
def remove_remote(self):
152146
name = self._cli_conf.get(CTFCliConfig.GLOBAL_SECTION_NAME, CTFCliConfig.CONFIG_REMOTE_NAME)

0 commit comments

Comments
 (0)