Skip to content

Commit

Permalink
chore: add some prep submodule step in vcs test
Browse files Browse the repository at this point in the history
  • Loading branch information
robcxyz committed Dec 17, 2023
1 parent 3608360 commit eb6fe2e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/utils/vcs/test_utils_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
get_default_branch,
get_repo_source,
get_latest_release_from_remote,
get_repo, run_command,
get_repo, run_command, git_clone,
)


Expand Down Expand Up @@ -64,6 +64,15 @@ def f(fixture: str = None):
settings.providers_dir = str(tmp_path)
try:
if fixture is not None:
# When pulling / in ci - the fixtures will be submodules. So we need to
# update them to have them available for copying
if not os.path.isdir(os.path.join(fixture, '.git')):
p = run_command('git submodule update')
stdout, stderr = p.communicate()
if p.returncode != 0:
raise Exception(
f"Error in git submodule \n{stdout}\n{stderr}"
)
shutil.copytree(fixture, os.path.join(tmp_path, 'robcxyz', fixture))
yield str(tmp_path)
finally:
Expand Down

0 comments on commit eb6fe2e

Please sign in to comment.