-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Speed up unit test by caching the git clone #3060
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import shutil | ||
import subprocess | ||
from pathlib import Path | ||
from subprocess import check_output | ||
from typing import Optional | ||
|
||
from samcli.lib.utils import osutils | ||
|
@@ -118,7 +119,7 @@ def clone(self, clone_dir: Path, clone_name: str, replace_existing: bool = False | |
temp_path = os.path.normpath(os.path.join(tempdir, clone_name)) | ||
git_executable: str = GitRepo._git_executable() | ||
LOG.info("\nCloning from %s", self.url) | ||
subprocess.check_output( | ||
check_output( | ||
[git_executable, "clone", self.url, clone_name], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if we shallow-clone instead? So that everyone benefits from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, and it alone produced time ranging from 37s to 67s. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reverted, wrong testing data |
||
cwd=tempdir, | ||
stderr=subprocess.STDOUT, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A "why" comment here will be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added