Skip to content
Permalink
Browse files

[FIX JENKINS-39132] No comments to Gerrit 2.13.1 for Change Merged tr…

…igger
  • Loading branch information
Jimilian committed Oct 6, 2017
1 parent 7c0ee34 commit 48e0ddc13d72ca57b884f1fe0f7c1f5b479d39c2
@@ -521,8 +521,8 @@ public String getBuildCompletedCommand(MemoryImprint memoryImprint, TaskListener
command = config.getGerritCmdBuildFailed();
}

Integer verified = 0;
Integer codeReview = 0;
Integer verified = null;
Integer codeReview = null;
Notify notifyLevel = Notify.ALL;
if (memoryImprint.getEvent().isScorable()) {
verified = getMinimumVerifiedValue(memoryImprint, onlyCountBuilt);
@@ -60,6 +60,7 @@

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@@ -469,7 +470,7 @@ public void tryGetBuildCompletedCommandSuccessful(String customUrl, String expec
*/
public void tryGetBuildCompletedCommandSuccessfulChangeAbandoned(String customUrl, String expectedBuildsStats)
throws IOException, InterruptedException {
tryGetBuildCompletedCommandSuccessfulEvent(customUrl, expectedBuildsStats, Setup.createChangeAbandoned(), 0, 0);
tryGetBuildCompletedCommandSuccessfulEvent(customUrl, expectedBuildsStats, Setup.createChangeAbandoned(), null, null);
}

/**
@@ -483,7 +484,7 @@ public void tryGetBuildCompletedCommandSuccessfulChangeAbandoned(String customUr
public void tryGetBuildCompletedCommandSuccessfulChangeMerged(String customUrl, String expectedBuildsStats)
throws IOException, InterruptedException {
tryGetBuildCompletedCommandSuccessfulEvent(customUrl, expectedBuildsStats,
Setup.createChangeMerged(), 0, 0);
Setup.createChangeMerged(), null, null);
}

/**
@@ -496,7 +497,7 @@ public void tryGetBuildCompletedCommandSuccessfulChangeMerged(String customUrl,
*/
public void tryGetBuildCompletedCommandSuccessfulChangeRestored(String customUrl, String expectedBuildsStats)
throws IOException, InterruptedException {
tryGetBuildCompletedCommandSuccessfulEvent(customUrl, expectedBuildsStats, Setup.createChangeRestored(), 0, 0);
tryGetBuildCompletedCommandSuccessfulEvent(customUrl, expectedBuildsStats, Setup.createChangeRestored(), null, null);
}

/**
@@ -512,12 +513,11 @@ public void tryGetBuildCompletedCommandSuccessfulChangeRestored(String customUrl
* @throws InterruptedException if so.
*/
public void tryGetBuildCompletedCommandSuccessfulEvent(String customUrl, String expectedBuildsStats,
GerritTriggeredEvent event, int expectedVerifiedVote,
int expectedCodeReviewVote)
GerritTriggeredEvent event, Integer expectedVerifiedVote, Integer expectedCodeReviewVote)
throws IOException, InterruptedException {
tryGetBuildCompletedCommandEventWithResults(customUrl, new String[] {expectedBuildsStats},
new Result[] {Result.SUCCESS}, "'Your friendly butler says OK.",
Setup.createChangeRestored(), 0, 0);
Setup.createChangeRestored(), null, null);
}

/**
@@ -536,7 +536,7 @@ public void tryGetBuildCompletedCommandSuccessfulEvent(String customUrl, String
*/
public void tryGetBuildCompletedCommandEventWithResults(String customUrl, String[] expectedBuildsStats,
Result[] expectedBuildResults, String expectedMessage, GerritTriggeredEvent event,
int expectedVerifiedVote, int expectedCodeReviewVote)
Integer expectedVerifiedVote, Integer expectedCodeReviewVote)
throws IOException, InterruptedException {

IGerritHudsonTriggerConfig config = Setup.createConfig();
@@ -587,15 +587,15 @@ public void tryGetBuildCompletedCommandEventWithResults(String customUrl, String
assertThat("Missing BS", result, containsStrings(expectedBuildsStats));
assertThat("Missing CHANGE_ID", result, containsString("CHANGE_ID=Iddaaddaa123456789"));
assertThat("Missing PATCHSET", result, containsString("PATCHSET=1"));
assertThat("Missing VERIFIED", result, containsString("VERIFIED=" + expectedVerifiedVote));
assertThat("Missing CODEREVIEW", result, containsString("CODEREVIEW=" + expectedCodeReviewVote));
assertThat("Missing NOTIFICATION_LEVEL", result, containsString("NOTIFICATION_LEVEL=ALL"));
assertThat("Missing REFSPEC", result, containsString("REFSPEC=" + expectedRefSpec));
assertThat("Missing ENV_BRANCH", result, containsString("ENV_BRANCH=branch"));
assertThat("Missing ENV_CHANGE", result, containsString("ENV_CHANGE=1000"));
assertThat("Missing ENV_REFSPEC", result, containsString("ENV_REFSPEC=" + expectedRefSpec));
assertThat("Missing ENV_CHANGEURL", result, containsString("ENV_CHANGEURL=http://gerrit/1000"));
assertThat("Missing CUSTOM_MESSAGES", result, containsString("CUSTOM_MESSAGE_BUILD_COMPLETED"));
assertThat("Missing VERIFIED", result, containsString("VERIFIED=" + expectedVerifiedVote));
assertThat("Missing CODEREVIEW", result, containsString("CODEREVIEW=" + expectedCodeReviewVote));
}


0 comments on commit 48e0ddc

Please sign in to comment.
You can’t perform that action at this time.