Merge "Merge branch 'stable-2.13'"
This commit is contained in:
@@ -760,9 +760,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createNewChangeForAllNotInTarget() throws Exception {
|
public void createNewChangeForAllNotInTarget() throws Exception {
|
||||||
ProjectConfig config = projectCache.checkedGet(project).getConfig();
|
enableCreateNewChangeForAllNotInTarget();
|
||||||
config.getProject().setCreateNewChangeForAllNotInTarget(InheritableBoolean.TRUE);
|
|
||||||
saveProjectConfig(project, config);
|
|
||||||
|
|
||||||
PushOneCommit push =
|
PushOneCommit push =
|
||||||
pushFactory.create(
|
pushFactory.create(
|
||||||
@@ -900,6 +898,16 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void pushWithoutChangeId() throws Exception {
|
public void pushWithoutChangeId() throws Exception {
|
||||||
|
testPushWithoutChangeId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void pushWithoutChangeIdWithCreateNewChangeForAllNotInTarget() throws Exception {
|
||||||
|
enableCreateNewChangeForAllNotInTarget();
|
||||||
|
testPushWithoutChangeId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testPushWithoutChangeId() throws Exception {
|
||||||
RevCommit c = createCommit(testRepo, "Message without Change-Id");
|
RevCommit c = createCommit(testRepo, "Message without Change-Id");
|
||||||
assertThat(GitUtil.getChangeId(testRepo, c).isPresent()).isFalse();
|
assertThat(GitUtil.getChangeId(testRepo, c).isPresent()).isFalse();
|
||||||
pushForReviewRejected(testRepo, "missing Change-Id in commit message footer");
|
pushForReviewRejected(testRepo, "missing Change-Id in commit message footer");
|
||||||
@@ -912,6 +920,16 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void pushWithMultipleChangeIds() throws Exception {
|
public void pushWithMultipleChangeIds() throws Exception {
|
||||||
|
testPushWithMultipleChangeIds();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void pushWithMultipleChangeIdsWithCreateNewChangeForAllNotInTarget() throws Exception {
|
||||||
|
enableCreateNewChangeForAllNotInTarget();
|
||||||
|
testPushWithMultipleChangeIds();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testPushWithMultipleChangeIds() throws Exception {
|
||||||
createCommit(
|
createCommit(
|
||||||
testRepo,
|
testRepo,
|
||||||
"Message with multiple Change-Id\n"
|
"Message with multiple Change-Id\n"
|
||||||
@@ -928,6 +946,16 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void pushWithInvalidChangeId() throws Exception {
|
public void pushWithInvalidChangeId() throws Exception {
|
||||||
|
testpushWithInvalidChangeId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void pushWithInvalidChangeIdWithCreateNewChangeForAllNotInTarget() throws Exception {
|
||||||
|
enableCreateNewChangeForAllNotInTarget();
|
||||||
|
testpushWithInvalidChangeId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testpushWithInvalidChangeId() throws Exception {
|
||||||
createCommit(testRepo, "Message with invalid Change-Id\n" + "\n" + "Change-Id: X\n");
|
createCommit(testRepo, "Message with invalid Change-Id\n" + "\n" + "Change-Id: X\n");
|
||||||
pushForReviewRejected(testRepo, "invalid Change-Id line format in commit message footer");
|
pushForReviewRejected(testRepo, "invalid Change-Id line format in commit message footer");
|
||||||
|
|
||||||
@@ -939,6 +967,17 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void pushWithInvalidChangeIdFromEgit() throws Exception {
|
public void pushWithInvalidChangeIdFromEgit() throws Exception {
|
||||||
|
testPushWithInvalidChangeIdFromEgit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void pushWithInvalidChangeIdFromEgitWithCreateNewChangeForAllNotInTarget()
|
||||||
|
throws Exception {
|
||||||
|
enableCreateNewChangeForAllNotInTarget();
|
||||||
|
testPushWithInvalidChangeIdFromEgit();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void testPushWithInvalidChangeIdFromEgit() throws Exception {
|
||||||
createCommit(
|
createCommit(
|
||||||
testRepo,
|
testRepo,
|
||||||
"Message with invalid Change-Id\n"
|
"Message with invalid Change-Id\n"
|
||||||
@@ -1344,4 +1383,10 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest {
|
|||||||
assertThat(refUpdate.getMessage()).contains(expectedMessage);
|
assertThat(refUpdate.getMessage()).contains(expectedMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void enableCreateNewChangeForAllNotInTarget() throws Exception {
|
||||||
|
ProjectConfig config = projectCache.checkedGet(project).getConfig();
|
||||||
|
config.getProject().setCreateNewChangeForAllNotInTarget(InheritableBoolean.TRUE);
|
||||||
|
saveProjectConfig(project, config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user