Acceptance test PR list

This commit is contained in:
William Martin 2024-10-14 14:31:24 +02:00
parent bfa5b6afa5
commit 1f94cf9dac
2 changed files with 25 additions and 1 deletions

View file

@ -20,5 +20,5 @@ exec git push -u origin feature-branch
exec gh pr create --title 'Feature Title' --body 'Feature Body'
# Check the PR is indeed created
exec gh pr list
exec gh pr view
stdout 'Feature Title'

24
acceptance/testdata/pr/pr-list.txtar vendored Normal file
View file

@ -0,0 +1,24 @@
# Use gh as a credential helper
exec gh auth setup-git
# Create a repository with a file so it has a default branch
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private
# Defer repo cleanup
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Clone the repo
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING
# Prepare a branch to PR
cd $SCRIPT_NAME-$RANDOM_STRING
exec git checkout -b feature-branch
exec git commit --allow-empty -m 'Empty Commit'
exec git push -u origin feature-branch
# Create the PR
exec gh pr create --title 'Feature Title' --body 'Feature Body'
# List PRs and see the new PR is in the list
exec gh pr list
stdout 'Feature Title\tfeature-branch\tOPEN'