Search in sources :

Example 1 with MatrixProject

use of org.jenkinsci.test.acceptance.po.MatrixProject in project acceptance-test-harness by jenkinsci.

the class MatrixReloadedPluginTest method rebuild_one_combination.

@Test
public void rebuild_one_combination() {
    MatrixProject job = jenkins.jobs.create(MatrixProject.class);
    job.configure();
    TextAxis x = job.addAxis(TextAxis.class);
    x.name.set("AAA");
    x.valueString.set("111 222");
    TextAxis y = job.addAxis(TextAxis.class);
    y.name.set("BBB");
    y.valueString.set("333 444");
    job.save();
    job.startBuild().waitUntilFinished();
    MatrixReloadedAction action = job.getLastBuild().action(MatrixReloadedAction.class);
    action.open();
    action.shouldHaveCombination("AAA=111,BBB=333").shouldHaveCombination("AAA=111,BBB=444").shouldHaveCombination("AAA=222,BBB=333").shouldHaveCombination("AAA=222,BBB=444");
    action.rebuild("AAA=111,BBB=333");
    MatrixBuild build = (MatrixBuild) job.getLastBuild().shouldSucceed();
    assertThat(build.getConfiguration("AAA=111,BBB=333"), exists());
    assertThat(build.getConfiguration("AAA=111,BBB=444"), not(exists()));
    assertThat(build.getConfiguration("AAA=222,BBB=333"), not(exists()));
    assertThat(build.getConfiguration("AAA=222,BBB=444"), not(exists()));
}
Also used : TextAxis(org.jenkinsci.test.acceptance.po.TextAxis) MatrixReloadedAction(org.jenkinsci.test.acceptance.plugins.matrix_reloaded.MatrixReloadedAction) MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) MatrixBuild(org.jenkinsci.test.acceptance.po.MatrixBuild) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 2 with MatrixProject

use of org.jenkinsci.test.acceptance.po.MatrixProject in project acceptance-test-harness by jenkinsci.

the class JobConfigHistoryPluginTest method track_change_in_matrix_project.

@Test
@Issue("JENKINS-24410")
@WithPlugins("matrix-project")
public void track_change_in_matrix_project() {
    MatrixProject job = jenkins.jobs.create(MatrixProject.class);
    JobConfigHistory history = job.action(JobConfigHistory.class);
    List<Change> original = history.getChanges();
    job.configure();
    job.runSequentially.check();
    job.save();
    List<Change> newOnes = history.getChanges();
    assertThat("New changes saved", newOnes.size(), greaterThan(original.size()));
}
Also used : JobConfigHistory(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory) Change(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change) MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 3 with MatrixProject

use of org.jenkinsci.test.acceptance.po.MatrixProject in project acceptance-test-harness by jenkinsci.

the class JavadocPluginTest method publish_javadoc_from_matrix_job.

@Test
@WithPlugins("matrix-project")
public void publish_javadoc_from_matrix_job() {
    MatrixProject job = jenkins.jobs.create(MatrixProject.class);
    setup(job);
    job.startBuild().shouldSucceed();
    MatrixConfiguration def = job.getConfiguration("default");
    assertThat(def, hasAction(JAVADOC_ACTION));
    assertJavadoc(def);
}
Also used : MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) MatrixConfiguration(org.jenkinsci.test.acceptance.po.MatrixConfiguration) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 4 with MatrixProject

use of org.jenkinsci.test.acceptance.po.MatrixProject in project acceptance-test-harness by jenkinsci.

the class ForemanNodeSharingPluginTest method testMatrixJob.

/**
 * Test a matrix job
 */
@Test
@WithPlugins("matrix-project")
public void testMatrixJob() {
    jenkins.save();
    MatrixProject job = jenkins.jobs.create(MatrixProject.class);
    job.configure();
    LabelExpressionAxis a = job.addAxis(LabelExpressionAxis.class);
    a.values.set("label1");
    job.addUserAxis("X", "1 2 3 4 5");
    job.save();
    MatrixBuild b = job.startBuild().as(MatrixBuild.class);
    b.waitUntilFinished(EXTENDED_PROVISION_TIMEOUT);
    for (MatrixRun config : b.getConfigurations()) {
        config.shouldSucceed();
    }
}
Also used : MatrixRun(org.jenkinsci.test.acceptance.po.MatrixRun) LabelExpressionAxis(org.jenkinsci.test.acceptance.po.LabelExpressionAxis) MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) MatrixBuild(org.jenkinsci.test.acceptance.po.MatrixBuild) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 5 with MatrixProject

use of org.jenkinsci.test.acceptance.po.MatrixProject in project acceptance-test-harness by jenkinsci.

the class OpenstackCloudPluginTest method scheduleMatrixWithoutLabel.

@Test
@Issue("JENKINS-29998")
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { MACHINE_USERNAME, "/openstack_plugin/unsafe" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
@WithPlugins("matrix-project")
public void scheduleMatrixWithoutLabel() {
    configureCloudInit("cloud-init");
    configureProvisioning("SSH", "label");
    jenkins.configure();
    jenkins.getConfigPage().numExecutors.set(0);
    jenkins.save();
    MatrixProject job = jenkins.jobs.create(MatrixProject.class);
    job.configure();
    job.save();
    MatrixBuild pb = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed().as(MatrixBuild.class);
    assertThat(pb.getNode(), equalTo((Node) jenkins));
    MatrixRun cb = pb.getConfiguration("default");
    assertThat(cb.getNode(), not(equalTo((Node) jenkins)));
}
Also used : Node(org.jenkinsci.test.acceptance.po.Node) MatrixRun(org.jenkinsci.test.acceptance.po.MatrixRun) MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) MatrixBuild(org.jenkinsci.test.acceptance.po.MatrixBuild) Issue(org.jvnet.hudson.test.Issue) WithCredentials(org.jenkinsci.test.acceptance.junit.WithCredentials) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins) TestActivation(org.jenkinsci.test.acceptance.junit.TestActivation)

Aggregations

MatrixProject (org.jenkinsci.test.acceptance.po.MatrixProject)8 Test (org.junit.Test)8 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)5 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)4 Issue (org.jvnet.hudson.test.Issue)4 MatrixBuild (org.jenkinsci.test.acceptance.po.MatrixBuild)3 MatrixConfiguration (org.jenkinsci.test.acceptance.po.MatrixConfiguration)2 MatrixRun (org.jenkinsci.test.acceptance.po.MatrixRun)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)1 TestActivation (org.jenkinsci.test.acceptance.junit.TestActivation)1 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)1 JobConfigHistory (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory)1 Change (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change)1 MatrixReloadedAction (org.jenkinsci.test.acceptance.plugins.matrix_reloaded.MatrixReloadedAction)1 Build (org.jenkinsci.test.acceptance.po.Build)1 LabelExpressionAxis (org.jenkinsci.test.acceptance.po.LabelExpressionAxis)1 ListView (org.jenkinsci.test.acceptance.po.ListView)1 Node (org.jenkinsci.test.acceptance.po.Node)1 TextAxis (org.jenkinsci.test.acceptance.po.TextAxis)1