Search in sources :

Example 1 with MatrixRun

use of org.jenkinsci.test.acceptance.po.MatrixRun 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 2 with MatrixRun

use of org.jenkinsci.test.acceptance.po.MatrixRun 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

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)2 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)2 MatrixBuild (org.jenkinsci.test.acceptance.po.MatrixBuild)2 MatrixProject (org.jenkinsci.test.acceptance.po.MatrixProject)2 MatrixRun (org.jenkinsci.test.acceptance.po.MatrixRun)2 Test (org.junit.Test)2 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)1 TestActivation (org.jenkinsci.test.acceptance.junit.TestActivation)1 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)1 LabelExpressionAxis (org.jenkinsci.test.acceptance.po.LabelExpressionAxis)1 Node (org.jenkinsci.test.acceptance.po.Node)1 Issue (org.jvnet.hudson.test.Issue)1