Skip to content

Commit

Permalink
Fix branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mfornet committed Sep 8, 2020
1 parent e20ced5 commit a0cdfe1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pytest/lib/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def compile_binary(branch):
# TODO: download pre-compiled binary from github for beta/stable?
prev_branch = current_branch()
stash_output = subprocess.check_output(['git', 'stash'])
subprocess.check_output(['git', 'checkout', branch])
subprocess.check_output(['git', 'checkout', str(branch)])
subprocess.check_output(['git', 'pull'])
compile_current()
subprocess.check_output(['git', 'checkout', prev_branch])
Expand Down
19 changes: 9 additions & 10 deletions pytest/tests/sanity/backward_compatible.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
import cluster


def main(near_root, stable_branch, new_branch):
print("Stable binary:", "%snear-%s" % (near_root, stable_branch))
print("New binary:", "%snear-%s" % (near_root, new_branch))

def main():
node_root = "/tmp/near/backward"
if os.path.exists(node_root):
shutil.rmtree(node_root)
subprocess.check_output('mkdir -p /tmp/near', shell=True)

# branch = branches.latest_beta_branch()
branch = 'd25f8c0700ae8eec09ecd6faef2ddfcef93734cf'
print(f"Latest beta release branch is {branch}")
near_root, (stable_branch,
current_branch) = branches.prepare_ab_test(branch)

# Setup local network.
subprocess.call([
"%snear-%s" % (near_root, stable_branch),
Expand All @@ -41,7 +44,7 @@ def main(near_root, stable_branch, new_branch):
stable_node = cluster.spin_up_node(config, near_root,
os.path.join(node_root, "test0"), 0,
None, None)
config["binary_name"] = "near-%s" % new_branch
config["binary_name"] = "near-%s" % current_branch
current_node = cluster.spin_up_node(config, near_root,
os.path.join(node_root, "test1"), 1,
stable_node.node_key.pk,
Expand All @@ -65,8 +68,4 @@ def main(near_root, stable_branch, new_branch):


if __name__ == "__main__":
# TODO(#3285): use proper branch
near_root, (stable_branch,
new_branch) = branches.prepare_ab_test('1.13.0')

main(near_root, stable_branch, new_branch)
main()

0 comments on commit a0cdfe1

Please sign in to comment.