Package hudson.model

Examples of hudson.model.Result


                String msg;

                // We do not use `build.getDurationString()` because it appends 'and counting' (build is still running)
                final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis());

                Result result = build.getResult();
                if (result == null) { // Build is ongoing
                    state = GHCommitState.PENDING;
                    msg = Messages.CommitNotifier_Pending(build.getDisplayName());
                } else if (result.isBetterOrEqualTo(SUCCESS)) {
                    state = GHCommitState.SUCCESS;
                    msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration);
                } else if (result.isBetterOrEqualTo(UNSTABLE)) {
                    state = GHCommitState.FAILURE;
                    msg = Messages.CommitNotifier_Unstable(build.getDisplayName(), duration);
                } else {
                    state = GHCommitState.ERROR;
                    msg = Messages.CommitNotifier_Failed(build.getDisplayName(), duration);
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
            throws InterruptedException, IOException {
        Result threshold = onlyStable ? Result.SUCCESS : Result.UNSTABLE;
        if (build.getResult().isWorseThan(threshold)) {
            listener.getLogger().println("Skipping Cobertura coverage report as build was not " + threshold.toString() + " or better ...");
            return true;
        }

        listener.getLogger().println("[Cobertura] Publishing Cobertura coverage report...");
        final FilePath[] moduleRoots = build.getModuleRoots();
View Full Code Here

    private boolean hasValidResult(final AbstractBuild<?, ?> build) {
        return hasValidResult(build, false, null);
    }

    private boolean hasValidResult(final AbstractBuild<?, ?> build, final boolean mustBeStable, @CheckForNull final ResultAction<? extends BuildResult> action) {
        Result result = build.getResult();

        if (result == null) {
            return false;
        }
        if (mustBeStable) {
            return result == Result.SUCCESS;
        }
        return result.isBetterThan(Result.FAILURE) || isPluginCauseForFailure(action);
    }
View Full Code Here

    // CHECKSTYLE:ON
        this.thresholds = thresholds;
        this.useDeltaValues = useDeltaValues;

        BuildResultEvaluator resultEvaluator = new BuildResultEvaluator(url);
        Result buildResult;
        StringBuilder messages = new StringBuilder();
        if (history.isEmpty() || !canComputeNew) {
            logger.log("Ignore new warnings since this is the first valid build");
            buildResult = resultEvaluator.evaluateBuildResult(messages, thresholds, getAnnotations());
        }
View Full Code Here

            final BuildListener listener, final Throwable error) throws InterruptedException, IOException {
        if (!acceptGoal(mojo.getGoal())) {
            return true;
        }

        Result currentResult = getCurrentResult(build);
        PluginLogger logger = new LoggerFactory(receiveSettingsFromMaster(build)).createLogger(listener.getLogger(), pluginName);

        if (!canContinue(currentResult)) {
            logger.log("Skipping reporter since build result is " + currentResult);
            return true;
View Full Code Here

     */
    @Deprecated
    public Result evaluateBuildResult(final PluginLogger logger, final Thresholds t,
            final Collection<? extends FileAnnotation> allAnnotations) {
        StringBuilder log = new StringBuilder();
        Result result = evaluateBuildResult(log, t, allAnnotations);
        logger.log(log.toString());
        return result;
    }
View Full Code Here

    @Deprecated
    public Result evaluateBuildResult(final PluginLogger logger, final Thresholds t,
            final Collection<? extends FileAnnotation> allAnnotations,
            final int delta, final int highDelta, final int normalDelta, final int lowDelta) {
        StringBuilder log = new StringBuilder();
        Result result = evaluateBuildResult(log, t, allAnnotations, delta, highDelta, normalDelta, lowDelta);
        logger.log(log.toString());
        return result;
    }
View Full Code Here

    @Deprecated
    public Result evaluateBuildResult(final PluginLogger logger, final Thresholds t,
            final Collection<? extends FileAnnotation> allAnnotations,
            final Collection<FileAnnotation> newAnnotations) {
        StringBuilder log = new StringBuilder();
        Result result = evaluateBuildResult(log, t, allAnnotations, newAnnotations);
        logger.log(log.toString());
        return result;
    }
View Full Code Here

            final BuildListener listener, final Throwable error) throws InterruptedException, IOException {
        PluginLogger logger = new LoggerFactory().createLogger(listener.getLogger(), pluginName);
        if (!acceptGoal(mojo.getGoal())) {
            return true;
        }
        Result currentResult = getCurrentResult(build);
        if (!canContinue(currentResult)) {
            logger.log("Skipping reporter since build result is " + currentResult);
            return true;
        }
View Full Code Here

        assertEquals(childProject1.getTouchStoneCombinationFilter(), combinationFilter);
    }

    @Test
    public void testGetTouchStoneResultConditionChildValue() throws IOException {
        Result parentResultCondition = Result.SUCCESS;
        Result childResultCondition = Result.FAILURE;
        MatrixProject parentProject = new MatrixProjectMock("parent");
        parentProject.setTouchStoneResultCondition(parentResultCondition);

        MatrixProject childProject1 = new MatrixProjectMock("child1");
        childProject1.setCascadingProject(parentProject);
View Full Code Here

TOP

Related Classes of hudson.model.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.