use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class CheckStylePluginTest method should_set_result_in_build_sequence_when_comparing_to_reference_build.
/**
* Creates a sequence of freestyle builds and checks if the build result is set correctly. New warning threshold is
* set to zero, e.g. a new warning should mark a build as unstable.
* <p/>
* <ol>
* <li>Build 1: 1 new, 0 fixed (SUCCESS since no reference build is set)</li>
* <li>Build 2: 2 new, 0 fixed (UNSTABLE since threshold is reached)</li>
* <li>Build 3: 1 new, 2 fixed (UNSTABLE since still one warning is new based on delta with reference build)</li>
* <li>Build 4: 0 new, 1 fixed (SUCCESS since there are no warnings)</li>
* </ol>
*/
@Test
public void should_set_result_in_build_sequence_when_comparing_to_reference_build() {
FreeStyleJob job = createFreeStyleJob();
runBuild(job, 1, Result.SUCCESS, 1, 0, false);
runBuild(job, 2, Result.UNSTABLE, 2, 0, false);
runBuild(job, 3, Result.UNSTABLE, 1, 1, false);
runBuild(job, 4, Result.SUCCESS, 0, 0, false);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method provisionJnlpSlave.
// The test will fail when test host is not reachable from openstack machine for obvious reasons
@Test
// TODO: JENKINS-30784 Do not bother with credentials for jnlp slaves
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { MACHINE_USERNAME, "/openstack_plugin/unsafe" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void provisionJnlpSlave() {
configureCloudInit("cloud-init-jnlp");
configureProvisioning("JNLP", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.save();
job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed();
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method sshSlaveShouldSurviveRestart.
@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { MACHINE_USERNAME, "ath" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void sshSlaveShouldSurviveRestart() {
assumeTrue("This test requires a restartable Jenkins", jenkins.canRestart());
configureCloudInit("cloud-init");
configureProvisioning("SSH", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.addShellStep("uname -a");
job.save();
Node created = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed().getNode();
jenkins.restart();
Node reconnected = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed().getNode();
assertEquals(created, reconnected);
Slave slave = ((Slave) reconnected);
slave.open();
slave.clickLink("Schedule Termination");
waitFor(slave, pageObjectDoesNotExist(), 1000);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method provisionSshSlaveWithPasswdAuth.
@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { MACHINE_USERNAME, "ath" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void provisionSshSlaveWithPasswdAuth() {
configureCloudInit("cloud-init");
configureProvisioning("SSH", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.save();
job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed();
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method useSingleUseSlave.
@Test
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { MACHINE_USERNAME, "/openstack_plugin/unsafe" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void useSingleUseSlave() {
configureCloudInit("cloud-init");
configureProvisioning("SSH", "label");
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression("label");
job.addBuildWrapper(OpenstackOneOffSlave.class);
job.save();
Build build = job.scheduleBuild().waitUntilFinished(PROVISIONING_TIMEOUT).shouldSucceed();
assertTrue(build.getNode().isTemporarillyOffline());
}
Aggregations