當前位置: 首頁>>代碼示例>>Java>>正文


Java Result.UNSTABLE屬性代碼示例

本文整理匯總了Java中hudson.model.Result.UNSTABLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Result.UNSTABLE屬性的具體用法?Java Result.UNSTABLE怎麽用?Java Result.UNSTABLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在hudson.model.Result的用法示例。


在下文中一共展示了Result.UNSTABLE屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addPoolValue

public void addPoolValue(Result buildResult, String poolValue) {
    allValues.add(poolValue);
    if (buildResult == Result.NOT_BUILT) {
        valuesFromRunningBuilds.add(poolValue);
        valuesFromFunctionalBuilds.remove(poolValue);
        valuesFromFailedBuilds.remove(poolValue);
    } else if (buildResult == Result.SUCCESS || buildResult == Result.UNSTABLE) {
        if (!valuesFromFailedBuilds.contains(poolValue) && !valuesFromRunningBuilds.contains(poolValue)) {
            valuesFromFunctionalBuilds.add(poolValue);
        }
    } else {
        if (!valuesFromFunctionalBuilds.contains(poolValue) && !valuesFromRunningBuilds.contains(poolValue)) {
            valuesFromFailedBuilds.add(poolValue);
        }
    }
}
 
開發者ID:damienbiggs,項目名稱:parameter-pool-plugin,代碼行數:16,代碼來源:BuildPoolValues.java

示例2: processBuildResult

void processBuildResult(boolean commentOnSuccess, boolean commentWithConsoleLinkOnFailure, boolean runHarbormaster) {
    if (result == Result.SUCCESS) {
        if (comment.length() == 0 && (commentOnSuccess || !runHarbormaster)) {
            comment.append("Build is green");
        }
    } else if (result == Result.UNSTABLE) {
        comment.append("Build is unstable");
    } else if (result == Result.FAILURE) {
        if (!runHarbormaster || commentWithConsoleLinkOnFailure) {
            comment.append("Build has FAILED");
        }
    } else if (result == Result.ABORTED) {
        comment.append("Build was aborted");
    } else {
        logger.info(UBERALLS_TAG, "Unknown build status " + result.toString());
    }
}
 
開發者ID:uber,項目名稱:phabricator-jenkins-plugin,代碼行數:17,代碼來源:CommentBuilder.java

示例3: markAsUnstableWhenAtRiskThreshold

private void markAsUnstableWhenAtRiskThreshold(int threshold, CodeSceneBuildActionEntry entry, Run<?, ?> build, TaskListener listener) throws IOException {
    if (isMarkBuildAsUnstable() && entry.getHitsRiskThreshold()) {
        String link = HyperlinkNote.encodeTo(entry.getViewUrl().toExternalForm(), String.format("Delta analysis result with risk %d", entry.getRisk().getValue()));
        listener.error("%s hits the risk threshold (%d). Marking build as unstable.", link, threshold);
        Result newResult = Result.UNSTABLE;

        Result result = build.getResult();
        if (result != null) {
            build.setResult(result.combine(newResult));
        } else {
            build.setResult(newResult);
        }
    }
}
 
開發者ID:empear-analytics,項目名稱:codescene-jenkins-plugin,代碼行數:14,代碼來源:CodeSceneBuilder.java

示例4: completed

public void completed(AbstractBuild r) {
    AbstractProject<?, ?> project = r.getProject();
    if(project == null) return;
    Result result = r.getResult();
    AbstractBuild<?, ?> previousBuild = project.getLastBuild();
    if(previousBuild == null) return;
    do {
        previousBuild = previousBuild.getPreviousCompletedBuild();
    } while (previousBuild != null && previousBuild.getResult() == Result.ABORTED);
    Result previousResult = (previousBuild != null) ? previousBuild.getResult() : Result.SUCCESS;
    if ((result == Result.ABORTED && notifier.getNotifyAborted())
            || (result == Result.FAILURE //notify only on single failed build
                && previousResult != Result.FAILURE
                && notifier.getNotifyFailure())
            || (result == Result.FAILURE //notify only on repeated failures
                && previousResult == Result.FAILURE
                && notifier.getNotifyRepeatedFailure())
            || (result == Result.NOT_BUILT && notifier.getNotifyNotBuilt())
            || (result == Result.SUCCESS
                && (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
                && notifier.getNotifyBackToNormal())
            || (result == Result.SUCCESS && notifier.getNotifySuccess())
            || (result == Result.UNSTABLE && notifier.getNotifyUnstable())) {
        getTelegram(r).publish(getBuildStatusMessage(r, notifier.includeTestSummary(),
                notifier.getIncludeFailedTests(),notifier.includeCustomMessage()), getBuildColor(r));

    }
}
 
開發者ID:FluffyFairyGames,項目名稱:jenkins-telegram-plugin,代碼行數:28,代碼來源:ActiveNotifier.java

示例5: completed

public void completed(AbstractBuild r) {
	AbstractProject<?, ?> project = r.getProject();
	Result result = r.getResult();
	AbstractBuild<?, ?> previousBuild = project.getLastBuild();
	if (previousBuild != null) {
		do {
			previousBuild = previousBuild.getPreviousCompletedBuild();
		} while (previousBuild != null && previousBuild.getResult() == Result.ABORTED);
	}
	Result previousResult = (previousBuild != null) ? previousBuild.getResult() : Result.SUCCESS;
	if ((result == Result.ABORTED && notifier.getNotifyAborted())
			|| (result == Result.FAILURE //notify only on single failed build
			&& previousResult != Result.FAILURE
			&& notifier.getNotifyFailure())
			|| (result == Result.FAILURE //notify only on repeated failures
			&& previousResult == Result.FAILURE
			&& notifier.getNotifyRepeatedFailure())
			|| (result == Result.NOT_BUILT && notifier.getNotifyNotBuilt())
			|| (result == Result.SUCCESS
			&& (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
			&& notifier.getNotifyBackToNormal())
			|| (result == Result.SUCCESS && notifier.getNotifySuccess())
			|| (result == Result.UNSTABLE && notifier.getNotifyUnstable())) {
		String expandedCustomMessage = getExpandedCustomMessage(r);
		getMattermost(r).publish(getBuildStatusMessage(r, notifier.includeTestSummary(),
				notifier.includeCustomAttachmentMessage()), expandedCustomMessage, getBuildColor(r));
		if (notifier.getCommitInfoChoice().showAnything()) {
			getMattermost(r).publish(getCommitList(r), expandedCustomMessage, getBuildColor(r));
		}
	}
}
 
開發者ID:jovandeginste,項目名稱:jenkins-mattermost-plugin,代碼行數:31,代碼來源:ActiveNotifier.java

示例6: from

public static States from(@Nonnull Result result) {
    if (result == Result.SUCCESS) {
        return success;
    }
    if (result == Result.FAILURE) {
        return error;
    }
    if (result == Result.UNSTABLE) {
        return failure;
    }
    return error;
}
 
開發者ID:jenkinsci,項目名稱:dockerhub-notification-plugin,代碼行數:12,代碼來源:DockerHubCallbackPayload.java

示例7: getState

public static GHCommitState getState(AbstractBuild<?, ?> build) {

        GHCommitState state;
        if (build.getResult() == Result.SUCCESS) {
            state = GHCommitState.SUCCESS;
        } else if (build.getResult() == Result.UNSTABLE) {
            state = GhprcTrigger.getDscp().getUnstableAs();
        } else {
            state = GHCommitState.FAILURE;
        }
        return state;
    }
 
開發者ID:bratchenko,項目名稱:jenkins-github-pull-request-comments,代碼行數:12,代碼來源:Ghprc.java

示例8: getBuildStatus

static MessageStatus getBuildStatus(AbstractBuild r){
    if (r.isBuilding()) {
        return MessageStatus.STARTING;
    }
    Run previousSuccessfulBuild = null;
    Run previousBuild = null;
    Result result = r.getResult();
    Result previousResult;
    try {
        previousBuild = r.getProject().getLastBuild().getPreviousBuild();
        previousSuccessfulBuild = r.getPreviousSuccessfulBuild();
    }catch (NullPointerException npe){
       return MessageStatus.UNKNOWN;
    }

    boolean buildHasSucceededBefore = previousSuccessfulBuild != null;

    /*
     * If the last build was aborted, go back to find the last non-aborted build.
     * This is so that aborted builds do not affect build transitions.
     * I.e. if build 1 was failure, build 2 was aborted and build 3 was a success the transition
     * should be failure -> success (and therefore back to normal) not aborted -> success.
     */
    Run lastNonAbortedBuild = previousBuild;
    while(lastNonAbortedBuild != null && lastNonAbortedBuild.getResult() == Result.ABORTED) {
        lastNonAbortedBuild = lastNonAbortedBuild.getPreviousBuild();
    }


    /* If all previous builds have been aborted, then use
     * SUCCESS as a default status so an aborted message is sent
     */
    if(lastNonAbortedBuild == null) {
        previousResult = Result.SUCCESS;
    } else {
        previousResult = lastNonAbortedBuild.getResult();
    }

    /* Back to normal should only be shown if the build has actually succeeded at some point.
     * Also, if a build was previously unstable and has now succeeded the status should be
     * "Back to normal"
     */
    if (result == Result.SUCCESS
            && (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
            && buildHasSucceededBefore) {
        return MessageStatus.BACK_TO_NORMAL;
    }
    if (result == Result.FAILURE && previousResult == Result.FAILURE) {
        return MessageStatus.STILL_FAILING;
    }
    if (result == Result.SUCCESS) {
        return MessageStatus.SUCCESS;
    }
    if (result == Result.FAILURE) {
        return MessageStatus.FAILURE;
    }
    if (result == Result.ABORTED) {
        return MessageStatus.ABORTED;
    }
    if (result == Result.NOT_BUILT) {
        return MessageStatus.NOT_BUILT;
    }
    if (result == Result.UNSTABLE) {
        return MessageStatus.UNSTABLE;
    }
    return MessageStatus.UNKNOWN;
}
 
開發者ID:FluffyFairyGames,項目名稱:jenkins-telegram-plugin,代碼行數:67,代碼來源:ActiveNotifier.java

示例9: getStatusMessage

static String getStatusMessage(AbstractBuild r) {
	if (r.isBuilding()) {
		return STARTING_STATUS_MESSAGE;
	}
	Result result = r.getResult();
	Result previousResult;
	Run lastBuild = r.getProject().getLastBuild();
	Run previousBuild = (lastBuild != null) ? lastBuild.getPreviousBuild() : null;
	Run previousSuccessfulBuild = r.getPreviousSuccessfulBuild();
	boolean buildHasSucceededBefore = previousSuccessfulBuild != null;

	/*
	 * If the last build was aborted, go back to find the last non-aborted build.
	 * This is so that aborted builds do not affect build transitions.
	 * I.e. if build 1 was failure, build 2 was aborted and build 3 was a success the transition
	 * should be failure -> success (and therefore back to normal) not aborted -> success.
	 */
	Run lastNonAbortedBuild = previousBuild;
	while (lastNonAbortedBuild != null && lastNonAbortedBuild.getResult() == Result.ABORTED) {
		lastNonAbortedBuild = lastNonAbortedBuild.getPreviousBuild();
	}


	/* If all previous builds have been aborted, then use
	 * SUCCESS as a default status so an aborted message is sent
	 */
	if (lastNonAbortedBuild == null) {
		previousResult = Result.SUCCESS;
	} else {
		previousResult = lastNonAbortedBuild.getResult();
	}

	/* Back to normal should only be shown if the build has actually succeeded at some point.
	 * Also, if a build was previously unstable and has now succeeded the status should be
	 * "Back to normal"
	 */
	if (result == Result.SUCCESS
			&& (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
			&& buildHasSucceededBefore) {
		return BACK_TO_NORMAL_STATUS_MESSAGE;
	}
	if (result == Result.FAILURE && previousResult == Result.FAILURE) {
		return STILL_FAILING_STATUS_MESSAGE;
	}
	if (result == Result.SUCCESS) {
		return SUCCESS_STATUS_MESSAGE;
	}
	if (result == Result.FAILURE) {
		return FAILURE_STATUS_MESSAGE;
	}
	if (result == Result.ABORTED) {
		return ABORTED_STATUS_MESSAGE;
	}
	if (result == Result.NOT_BUILT) {
		return NOT_BUILT_STATUS_MESSAGE;
	}
	if (result == Result.UNSTABLE) {
		return UNSTABLE_STATUS_MESSAGE;
	}
	return UNKNOWN_STATUS_MESSAGE;
}
 
開發者ID:jovandeginste,項目名稱:jenkins-mattermost-plugin,代碼行數:61,代碼來源:ActiveNotifier.java

示例10: commentErrorIsUnstable

public void commentErrorIsUnstable() {
    errorHandler = new PublisherErrorHandler(Result.UNSTABLE);
}
 
開發者ID:KostyaSha,項目名稱:github-integration-plugin,代碼行數:3,代碼來源:GitHubCommentPublisherDslContext.java

示例11: onlyUnstableBuilds

public void onlyUnstableBuilds() {
    verifier = new StatusVerifier(Result.UNSTABLE);
}
 
開發者ID:KostyaSha,項目名稱:github-integration-plugin,代碼行數:3,代碼來源:GitHubCommentPublisherDslContext.java


注:本文中的hudson.model.Result.UNSTABLE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。