Skip to content

Commit

Permalink
Change bootstrap.py to fix the periodic test. (#56)
Browse files Browse the repository at this point in the history
* For periodic test REPO_OWNER and REPO_NAME won't be set so we
  need to hard code the value.
  • Loading branch information
jlewi committed Oct 18, 2017
1 parent 9a97daa commit 0433b20
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test-infra/image/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ def clone_repo():
"""
go_path = os.getenv("GOPATH")
# REPO_OWNER and REPO_NAME are the environment variables set by Prow.
repo_owner = os.getenv("REPO_OWNER")
repo_name = os.getenv("REPO_NAME")
# REPO_OWNER and REPO_NAME won't be set for periodic jobs so we resort
# to default values.
repo_owner = os.getenv("REPO_OWNER", GO_REPO_OWNER)
repo_name = os.getenv("REPO_NAME", GO_REPO_NAME)

if bool(repo_owner) != bool(repo_name):
raise ValueError("Either set both environment variables "
Expand All @@ -57,14 +59,6 @@ def clone_repo():
src_dir = os.path.join(go_path, "src/github.com", GO_REPO_OWNER)
dest = os.path.join(src_dir, GO_REPO_NAME)

if not repo_owner and not repo_name:
logging.info("Environment variables REPO_OWNER and REPO_NAME not set; "
"not checking out code.")
if not os.path.exists(dest):
raise ValueError("No code found at %s", dest)
# TODO(jlewi): We should get the sha number and add "-dirty" if needed
return dest, ""

# Clone mlkube
repo = "https://github.com/{0}/{1}.git".format(repo_owner, repo_name)
logging.info("repo %s", repo)
Expand Down

0 comments on commit 0433b20

Please sign in to comment.