Skip to content

Commit

Permalink
debug test failure 4
Browse files Browse the repository at this point in the history
  • Loading branch information
joezuntz committed Oct 17, 2022
1 parent e808682 commit f01a2b9
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions cosmosis/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,26 @@ def setup_git_repo():
os.mkdir(repo_subdir)

cmd = ["git", "init", "."]
p = subprocess.run(cmd, cwd=repo_dir, capture_output=True)
print('init stdout:', p.stdout)
print('init stderr:', p.stderr)
p = subprocess.run(cmd, cwd=repo_dir)
cmd = ["git", "config", "--local", "user.email", "[email protected]"]
p = subprocess.run(cmd, cwd=repo_dir)
cmd = ["git", "config", "--local", "user.name", "Test User"]
p = subprocess.run(cmd, cwd=repo_dir)


with open(f"{repo_subdir}/f.txt", "w") as f:
f.write("hello\n")

cmd = ["git", "add", "subdir/f.txt"]
p = subprocess.run(cmd, cwd=repo_dir, capture_output=True)
print('add stdout:', p.stdout)
print('add stderr:', p.stderr)
p = subprocess.run(cmd, cwd=repo_dir)

cmd = ["git", "commit", "-m", "added_file"]
p = subprocess.run(cmd, cwd=repo_dir, capture_output=True)
print('commit stdout:', p.stdout)
print('commit stderr:', p.stderr)
p = subprocess.run(cmd, cwd=repo_dir)

cmd = ["git", "log"]
p = subprocess.run(cmd, cwd=repo_dir, capture_output=True, universal_newlines=True)
print('log stdout:', p.stdout)
print('log stderr:', p.stderr)

sha = p.stdout.split("\n")[0].split()[1]

yield sha, repo_dir, repo_subdir
Expand Down

0 comments on commit f01a2b9

Please sign in to comment.