Acceptance test PR creation with metadata
This commit is contained in:
parent
fbc72fd2be
commit
4d986aaed4
3 changed files with 28 additions and 2 deletions
26
acceptance/testdata/pr/pr-create-with-metadata.txtar
vendored
Normal file
26
acceptance/testdata/pr/pr-create-with-metadata.txtar
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# 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' --assignee '@me' --label 'bug'
|
||||
stdout2env PR_URL
|
||||
|
||||
# Check the PR is indeed created
|
||||
exec gh pr view $PR_URL
|
||||
stdout 'assignees:\t.*$'
|
||||
stdout 'labels:\tbug$'
|
||||
|
|
@ -31,7 +31,7 @@ exec gh pr merge $PR_URL --merge
|
|||
|
||||
# Check that the state of the PR is now merged
|
||||
exec gh pr view $PR_URL
|
||||
stdout 'state:\tMERGED'
|
||||
stdout 'state:\tMERGED$'
|
||||
|
||||
# Pull and check the file exists on the main branch
|
||||
exec git pull -r
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ exec gh pr merge $PR_URL --rebase
|
|||
|
||||
# Check that the state of the PR is now merged
|
||||
exec gh pr view $PR_URL
|
||||
stdout 'state:\tMERGED'
|
||||
stdout 'state:\tMERGED$'
|
||||
|
||||
# Pull and check the file exists on the main branch
|
||||
exec git pull -r
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue