Package hudson.model

Examples of hudson.model.Run$Runner


        //      we should find a table

        //      Inside that table, there should be the following rows:
        //           org.jvnet.hudson.examples.small   0ms   0 -1 0   3
        //          org.jvnet.hudson.examples.small.deep   4ms 0 0 0  1
        Run theRun = proj.getBuildByNumber(7);
        assertTestResultsAsExpected(wc, theRun, "/testReport",
                "org.jvnet.hudson.examples.small", "0 ms", "SUCCESS",
                /* total tests expected, diff */ 3, 0,
                /* fail count expected, diff */ 0, -1,
                /* skip count expected, diff */ 0, 0);
View Full Code Here


        }
        assertNotNull("We should have a project named " + TEST_PROJECT_WITH_HISTORY, proj);

        // Validate that there are test results where I expect them to be:
        HudsonTestCase.WebClient wc = new HudsonTestCase.WebClient();
        Run theRun = proj.getBuildByNumber(4);
        assertTestResultsAsExpected(wc, theRun, "/testReport",
                        "org.jvnet.hudson.examples.small", "12 ms", "FAILURE",
                        /* total tests expected, diff */ 3, 0,
                        /* fail count expected, diff */ 1, 0,
                        /* skip count expected, diff */ 0, 0);
View Full Code Here

        diskUsage.put("notLoaded", notLoaded);
        return diskUsage;
    }
   
    public BuildDiskUsageAction getLastBuildAction() {
        Run run = project.getLastBuild();
        if (run != null) {
            return run.getAction(BuildDiskUsageAction.class);
        }

        return null;
    }
View Full Code Here

        } else if (job != null && !job.isEmpty()) {
            TopLevelItem item = Hudson.getInstance().getItem(job);
            if (item != null && item instanceof AbstractProject) {
                AbstractProject project = (AbstractProject)item;
                if (build != null && build >= 0) {
                    Run buildByNumber = project.getBuildByNumber(build);
                    if (buildByNumber != null) {
                        MetadataBuildAction action = buildByNumber.getAction(MetadataBuildAction.class);
                        if (action != null) {
                            container = action;
                        } else if (createContainer) {
                            action = new MetadataBuildAction();
                            buildByNumber.addAction(action);
                            container = action;
                        } else {
                            throw new NoMetadataException("Build #" + build + " of job "
                                    + job + " has no associated metadata.");
                        }
View Full Code Here

    projectB.updateNextBuildNumber(3);

    int expectedBuildNumber = projectB.getNextBuildNumber();
    projectA.scheduleBuild2(0, new UserCause()).get();

    Run buildB1 = projectB.getBuildByNumber(expectedBuildNumber);
    EnvVars envVars = builder.getEnvVars();
    //System.out.println("envVars: " + envVars);

    assertThat(envVars, notNullValue());
    assertThat(envVars, hasEntry("LAST_TRIGGERED_JOB_NAME", "projectB"));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_NUMBER_projectB", Integer.toString(expectedBuildNumber)));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_RESULT_projectB", buildB1.getResult().toString()));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_RESULT_projectB_RUN_" + Integer.toString(expectedBuildNumber), buildB1.getResult().toString()));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_RUN_COUNT_projectB", "1"));
    assertThat(envVars, hasEntry("TRIGGERED_JOB_NAMES", "projectB"));

    // The below test for expectedBuildNumber is meaningless if the
    // value doesn't update, though it should always update.
View Full Code Here

    int expectedBuildNumber = projectB.getNextBuildNumber();
    int expectedBuildNumberC = projectC.getNextBuildNumber();
    projectA.scheduleBuild2(0, new UserCause()).get();
    waitUntilNoActivity();

    Run buildB1 = projectB.getBuildByNumber(expectedBuildNumber);
    Run buildC1 = projectC.getBuildByNumber(expectedBuildNumberC);
    EnvVars envVars = builder.getEnvVars();
    //System.out.println("envVars: " + envVars);

    assertThat(envVars, notNullValue());
    assertThat(envVars, hasEntry("LAST_TRIGGERED_JOB_NAME", "projectB"));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_NUMBER_projectB", Integer.toString(expectedBuildNumber)));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_RESULT_projectB", buildB1.getResult().toString()));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_RESULT_projectB_RUN_" + Integer.toString(expectedBuildNumber), buildB1.getResult().toString()));
    assertThat(envVars, hasEntry("TRIGGERED_BUILD_RUN_COUNT_projectB", "1"));
    assertThat(envVars, hasEntry("TRIGGERED_JOB_NAMES", "projectB"));
    // check that we don't see entries for projectC
    assertThat(envVars, not(hasEntry("TRIGGERED_BUILD_NUMBER_projectC", Integer.toString(expectedBuildNumberC))));
    assertThat(envVars, not(hasEntry("TRIGGERED_BUILD_RESULT_projectC_RUN_" + Integer.toString(expectedBuildNumberC), buildC1.getResult().toString())));

  }
View Full Code Here

        projectA.getPublishersList().add(new BuildTrigger(
                new BuildTriggerConfig("projectB", ResultCondition.SUCCESS,
                    new CurrentBuildParameters(),
                    new PredefinedBuildParameters("BAZ=moo\nHOHO=blah"))));
        hudson.rebuildDependencyGraph();
        Run r = (Run)projectA.scheduleBuild2(0, new UserCause(), new ParametersAction(
                new StringParameterValue("BAR", "foo"),
                new StringParameterValue("BAZ", "override-me"))).get();
        Queue.Item q = hudson.getQueue().getItem(projectB);
        assertNotNull("projectB should be triggered: " + getLog(r), q);
        r = (Run)q.getFuture().get();
        assertEquals("should be exactly one ParametersAction", 1,
                     r.getActions(ParametersAction.class).size());
        EnvVars envVars = builder.getEnvVars();
        assertNotNull("builder should record environment", envVars);
        assertEquals("FOO", "bar", envVars.get("FOO"));
        assertEquals("BAR", "foo", envVars.get("BAR"));
        assertEquals("BAZ", "moo", envVars.get("BAZ"));
View Full Code Here

                trigger = false;
            }
            else {
                AbstractBuild<?,?> dlb = down.getLastBuild(); // can be null.
                for (AbstractIvyProject up : Util.filter(down.getUpstreamProjects(),AbstractIvyProject.class)) {
                    Run ulb;
                    if(up==getParent()) {
                        // the current build itself is not registered as lastSuccessfulBuild
                        // at this point, so we have to take that into account. ugly.
                        if(getResult()==null || !getResult().isWorseThan(Result.UNSTABLE))
                            ulb = this;
                        else
                            ulb = up.getLastSuccessfulBuild();
                    } else
                        ulb = up.getLastSuccessfulBuild();
                    if(ulb==null) {
                        // if no usable build is available from the upstream,
                        // then we have to wait at least until this build is ready
                        if(debug)
                            listener.getLogger().println(" -> No, because another upstream "+up+" for "+down+" has no successful build");
                        trigger = false;
                        break;
                    }
                   
                    // if no record of the relationship in the last build
                    // is available, we'll just have to assume that the condition
                    // for the new build is met, or else no build will be fired forever.
                    if(dlb==null)   continue;
                    int n = dlb.getUpstreamRelationship(up);
                    if(n==-1)   continue;
                   
                    assert ulb.getNumber()>=n;
                }
            }
           
            if(trigger) {
                listener.getLogger().println(Messages.IvyBuild_Triggering(down.getName()));
View Full Code Here

        story.addStep(new Statement() {
                          @Override
                          public void evaluate() throws Throwable {
                              story.j.waitUntilNoActivity();
                              FreeStyleProject p1 = story.j.jenkins.getItemByFullName("test1", FreeStyleProject.class);
                              Run r = p1.getLastBuild();
                              assertNotNull(r);
                              assertEquals(1, r.number);
                              assertEquals(Result.SUCCESS, r.getResult());
                              assertEquals(0, story.j.jenkins.getQueue().getItems().length);
                          }
                      }
        );
    }
View Full Code Here

    private transient ArtifactUnarchiverStep step;

    @Override
    protected List<FilePath> run() throws Exception {
        // where to copy artifacts from?
        Run r = build; // TODO consider an option to override this (but in what format?)

        ArtifactManager am = r.getArtifactManager();

        List<FilePath> files = new ArrayList<FilePath>();

        if (step.mapping == null)
            throw new AbortException("'mapping' has not been defined for this 'unarchive' step");
View Full Code Here

TOP

Related Classes of hudson.model.Run$Runner

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.