-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move more integration tests to RobotView
Port more of the integration tests that currently rely on with-term to the new RobotView mechanism. The couple remaining with-term tests are harder to port to RobotView as they rely on more advanced functionality. [skip changelog]: no user facing changes
- Loading branch information
Showing
9 changed files
with
172 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# branch checkout with lots of branches | ||
# and no argument prompts for branch name. | ||
|
||
[!unix] skip # pending github.com/creack/pty/pull/155 | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-03-30T14:59:32Z' | ||
|
||
|
@@ -31,28 +29,30 @@ git commit -m 'Add qux' | |
git checkout -b quux main | ||
git merge -m 'Merge many' foo bar baz qux | ||
|
||
env ROBOT_INPUT=$WORK/robot.golden ROBOT_OUTPUT=$WORK/robot.actual | ||
|
||
# showing only tracked branches | ||
gs trunk | ||
with-term -rows 8 -cols 50 $WORK/input/tracked.txt -- gs branch checkout | ||
cmp stdout $WORK/golden/prompt-tracked.txt | ||
gs branch checkout | ||
git branch --show-current | ||
stdout 'bar' | ||
|
||
# showing all branches | ||
gs trunk | ||
with-term -rows 8 -cols 50 $WORK/input/all.txt -- gs branch checkout -u | ||
cmp stdout $WORK/golden/prompt-all.txt | ||
gs branch checkout -u | ||
git branch --show-current | ||
stdout 'baz' | ||
|
||
# showing all branches via config | ||
gs branch untrack baz | ||
gs trunk | ||
with-term -rows 8 -cols 50 $WORK/input/all.txt -- gs branch checkout -u | ||
cmp stdout $WORK/golden/prompt-all.txt | ||
git config spice.branchCheckout.showUntracked true | ||
gs branch checkout | ||
git branch --show-current | ||
stdout 'baz' | ||
|
||
cmp $WORK/robot.actual $WORK/robot.golden | ||
|
||
-- repo/foo.txt -- | ||
whatever | ||
|
||
|
@@ -65,55 +65,34 @@ whatever | |
-- repo/qux.txt -- | ||
whatever | ||
|
||
-- input/tracked.txt -- | ||
await Select a branch | ||
snapshot init | ||
feed ba | ||
await | ||
snapshot after | ||
feed \r | ||
|
||
-- input/all.txt -- | ||
await Select a branch | ||
snapshot init | ||
feed ba | ||
await | ||
snapshot after-ba | ||
feed \x1b[B | ||
await | ||
snapshot select | ||
feed z\r | ||
await Do you want to track | ||
snapshot track | ||
feed \r | ||
|
||
-- golden/prompt-tracked.txt -- | ||
### init ### | ||
Select a branch to checkout: | ||
┏━□ bar | ||
┣━□ foo | ||
main ◀ | ||
### after ### | ||
Select a branch to checkout: | ||
bar ◀ | ||
-- golden/prompt-all.txt -- | ||
### init ### | ||
Select a branch to checkout: | ||
baz | ||
┏━□ bar | ||
┣━□ foo | ||
main ◀ | ||
quux | ||
qux | ||
### after-ba ### | ||
Select a branch to checkout: | ||
baz | ||
bar ◀ | ||
### select ### | ||
Select a branch to checkout: | ||
baz ◀ | ||
bar | ||
### track ### | ||
Select a branch to checkout: baz | ||
WRN baz: branch not tracked | ||
Do you want to track this branch now?: [Y/n] | ||
-- robot.golden -- | ||
=== | ||
> Select a branch to checkout: | ||
> ┏━□ bar | ||
> ┣━□ foo | ||
> main ◀ | ||
"bar" | ||
=== | ||
> Select a branch to checkout: | ||
> baz | ||
> ┏━□ bar | ||
> ┣━□ foo | ||
> main ◀ | ||
> quux | ||
> qux | ||
"baz" | ||
=== | ||
> Do you want to track this branch now?: [Y/n] | ||
true | ||
=== | ||
> Select a branch to checkout: | ||
> baz | ||
> ┏━□ bar | ||
> ┣━□ foo | ||
> main ◀ | ||
> quux | ||
> qux | ||
"baz" | ||
=== | ||
> Do you want to track this branch now?: [Y/n] | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ | |
# | ||
# https://github.com/abhinav/git-spice/issues/258 | ||
|
||
[!unix] skip # pending github.com/creack/pty/pull/155 | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-07-20T22:53:32Z' | ||
|
||
|
@@ -20,22 +18,20 @@ git branch c | |
git branch d | ||
|
||
git checkout c | ||
with-term -final exit $WORK/input.txt -- gs branch delete | ||
cmp stdout $WORK/golden.txt | ||
env ROBOT_INPUT=$WORK/robot.golden ROBOT_OUTPUT=$WORK/robot.actual | ||
gs branch delete | ||
cmp $WORK/robot.actual $WORK/robot.golden | ||
cmp stderr $WORK/stderr.golden | ||
|
||
-- input.txt -- | ||
await Select a branch | ||
snapshot prompt | ||
feed \r | ||
-- golden.txt -- | ||
### prompt ### | ||
Select a branch to delete: | ||
a | ||
b | ||
c ◀ | ||
d | ||
main | ||
### exit ### | ||
Select a branch to delete: c | ||
-- robot.golden -- | ||
=== | ||
> Select a branch to delete: | ||
> a | ||
> b | ||
> c ◀ | ||
> d | ||
> main | ||
true | ||
-- stderr.golden -- | ||
INF branch is not tracked: deleting anyway branch=c | ||
INF c: deleted (was 2848185) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# branch split supports reassigning submitted CRs | ||
# to a different branch. | ||
|
||
[!unix] skip # pending https://github.com/creack/pty/pull/155 | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-10-26T17:30:31Z' | ||
|
||
|
@@ -34,8 +32,10 @@ cmp stderr $WORK/golden/ll-before.txt | |
gs bs --fill | ||
|
||
# splitting the branch prompts for reassignment | ||
with-term -final exit $WORK/input/prompt.txt -- gs branch split --at HEAD~2:feat1 --at HEAD^:feat2 | ||
cmp stdout $WORK/golden/prompt.txt | ||
env ROBOT_INPUT=$WORK/robot.golden ROBOT_OUTPUT=$WORK/robot.actual | ||
gs branch split --at HEAD~2:feat1 --at HEAD^:feat2 | ||
cmp $WORK/robot.actual $WORK/robot.golden | ||
cmp stderr $WORK/stderr.golden | ||
|
||
gs ll -a | ||
cmp stderr $WORK/golden/ll-split.txt | ||
|
@@ -71,32 +71,18 @@ new feat 1 | |
┃ f9c1263 feat2 (now) | ||
┃ 1578492 feat1 (now) | ||
main | ||
-- input/prompt.txt -- | ||
await Assign CR #1 to branch | ||
snapshot init | ||
feed feat1 | ||
await | ||
snapshot search | ||
feed \r | ||
-- golden/prompt.txt -- | ||
### init ### | ||
Assign CR #1 to branch: | ||
|
||
feat1 | ||
feat2 | ||
▶ features | ||
|
||
Branch being split has an open CR assigned to it. | ||
Select which branch should take over the CR. | ||
### search ### | ||
Assign CR #1 to branch: | ||
|
||
▶ feat1 | ||
|
||
Branch being split has an open CR assigned to it. | ||
Select which branch should take over the CR. | ||
### exit ### | ||
Assign CR #1 to branch: feat1 | ||
-- robot.golden -- | ||
=== | ||
> Assign CR #1 to branch: | ||
> | ||
> feat1 | ||
> feat2 | ||
> ▶ features | ||
> | ||
> Branch being split has an open CR assigned to it. | ||
> Select which branch should take over the CR. | ||
"feat1" | ||
-- stderr.golden -- | ||
INF features: Upstream branch 'features' transferred to 'feat1' | ||
WRN features: If you push this branch with 'git push' instead of 'gs branch submit', | ||
WRN features: remember to use a different upstream branch name with the command: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# branch submit should not truncate a long body. | ||
# https://github.com/abhinav/git-spice/issues/90 | ||
|
||
[!unix] skip # pending github.com/creack/pty/pull/155 | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-05-23T20:06:32Z' | ||
|
||
|
@@ -30,8 +28,9 @@ git log -n1 --format=%B | |
cmp stdout $WORK/input/commit-msg | ||
|
||
# submit the branch | ||
with-term $WORK/input/prompt.txt -- gs branch submit | ||
cmp stdout $WORK/golden/prompt.txt | ||
env ROBOT_INPUT=$WORK/robot.golden ROBOT_OUTPUT=$WORK/robot.actual | ||
gs branch submit | ||
cmp $WORK/robot.actual $WORK/robot.golden | ||
|
||
shamhub dump changes | ||
stdout 'End of message.' | ||
|
@@ -58,22 +57,16 @@ no sea takimata sanctus est Lorem ipsum dolor sit amet. | |
|
||
End of message. | ||
|
||
-- input/prompt.txt -- | ||
await Title: | ||
snapshot initial | ||
feed \t | ||
await Body: | ||
feed \t | ||
await Draft: | ||
snapshot last | ||
feed \r | ||
|
||
-- golden/prompt.txt -- | ||
### initial ### | ||
Title: Add feature | ||
Short summary of the change | ||
### last ### | ||
Title: Add feature | ||
Body: Press [e] to open mockedit or [enter/tab] to skip | ||
Draft: [y/N] | ||
Mark the change as a draft? | ||
-- robot.golden -- | ||
=== | ||
> Title: Add feature | ||
> Short summary of the change | ||
"Add feature" | ||
=== | ||
> Body: Press [e] to open mockedit or [enter/tab] to skip | ||
> Open your editor to write a detailed description of the change | ||
{} | ||
=== | ||
> Draft: [y/N] | ||
> Mark the change as a draft? | ||
false |
Oops, something went wrong.