diff options
author | Nasser Grainawi <nasser.grainawi@linaro.org> | 2023-12-07 12:16:36 -0700 |
---|---|---|
committer | Nasser Grainawi <nasser.grainawi@linaro.org> | 2024-04-03 11:17:27 -0700 |
commit | 931ddf5993b878b72b4de63f478925bdb63b3af8 (patch) | |
tree | 587e8ca26ed5c6e4c28957fa9978664f38ac618f | |
parent | 18fef7ea6d64d1b4be766eab5aecde2ef3e4fd84 (diff) |
Test submitting a change with WIP parent
Add a new test for this behavior to show that the child change does not
cause a regression or any change in behavior for submit.
Release-Notes: skip
Change-Id: I4b45699ceccbdc3cf71e007ad8487f11f8304972
(cherry picked from commit 07e2deb03bc15959959c036bad30e418c094508f)
-rw-r--r-- | javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java index 0e4f2124c9..f561a5ad19 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java @@ -186,7 +186,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { .create( admin.newIdent(), testRepo, - "parent 2", + "parent 1", ImmutableMap.of("foo", "foo-2", "bar", "bar-2")) .to("refs/heads/master"); @@ -205,7 +205,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { .create( admin.newIdent(), testRepo, - "parent 1", + "parent 2", ImmutableMap.of("foo", "foo-1", "bar", "bar-1")) .to("refs/heads/stable"); @@ -564,6 +564,25 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { } @Test + public void submitParentIsWorkInProgressChange() throws Throwable { + PushOneCommit.Result parent = pushTo("refs/for/master%wip"); + PushOneCommit.Result change = createChange(); + Change.Id num = parent.getChange().getId(); + if (getSubmitType() == SubmitType.CHERRY_PICK) { + submit(change.getChangeId()); + } else { + submitWithConflict( + change.getChangeId(), + "Failed to submit 2 changes due to the following problems:\n" + + "Change " + + num + + ": Change " + + num + + " is work in progress"); + } + } + + @Test public void submitWithHiddenBranchInSameTopic() throws Throwable { assume().that(isSubmitWholeTopicEnabled()).isTrue(); PushOneCommit.Result visible = createChange("refs/for/master%topic=" + name("topic")); |