Search in sources :

Example 11 with Slave

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

the class ScriptlerPluginTest method run_on_all_slaves.

@Test
public void run_on_all_slaves() throws Exception {
    Slave slaveA = slaves.install(jenkins).get();
    Slave slaveB = slaves.install(jenkins).get();
    Script script = scriptler.upload(SIMPLE_SCRIPT);
    ScriptResult output = script.runOnAllSlaves();
    assertThat(output.output(jenkins), nullValue());
    assertThat(output.output(slaveA), equalTo("Hello world!"));
    assertThat(output.output(slaveB), equalTo("Hello world!"));
}
Also used : ScriptResult(org.jenkinsci.test.acceptance.plugins.scriptler.ScriptResult) Script(org.jenkinsci.test.acceptance.plugins.scriptler.Script) Slave(org.jenkinsci.test.acceptance.po.Slave) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 12 with Slave

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

the class ScriptlerPluginTest method run_on_slave.

@Test
public void run_on_slave() throws Exception {
    Slave slave = slaves.install(jenkins).get();
    Script script = scriptler.upload(SIMPLE_SCRIPT);
    String output = script.runOn(slave).output(slave);
    assertThat(output, equalTo("Hello world!"));
}
Also used : Script(org.jenkinsci.test.acceptance.plugins.scriptler.Script) Slave(org.jenkinsci.test.acceptance.po.Slave) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 13 with Slave

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

the class AuditTrailPluginTest method trail_should_contain_logged_events.

@Test
public void trail_should_contain_logged_events() throws Exception {
    FreeStyleJob freeStyleJob = jenkins.jobs.create(FreeStyleJob.class);
    // purpose of this is to just go through the motion of creating a new slave,
    // so this one can bypass SlaveController.
    Slave slave = new LocalSlaveController().install(jenkins).get();
    List<String> events = auditTrail.getEvents();
    assertThat(events, hasItem("/createItem (" + freeStyleJob.name + ")"));
    assertThat(events, hasItem("/computer/createItem (" + slave.getName() + ")"));
}
Also used : Slave(org.jenkinsci.test.acceptance.po.Slave) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) LocalSlaveController(org.jenkinsci.test.acceptance.slave.LocalSlaveController) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Aggregations

Slave (org.jenkinsci.test.acceptance.po.Slave)13 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)8 Test (org.junit.Test)8 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)4 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)3 DumbSlave (org.jenkinsci.test.acceptance.po.DumbSlave)3 Script (org.jenkinsci.test.acceptance.plugins.scriptler.Script)2 LocalSlaveController (org.jenkinsci.test.acceptance.slave.LocalSlaveController)2 File (java.io.File)1 IOException (java.io.IOException)1 ExecutionException (java.util.concurrent.ExecutionException)1 Future (java.util.concurrent.Future)1 TimeUnit (java.util.concurrent.TimeUnit)1 BasicFuture (org.apache.http.concurrent.BasicFuture)1 DockerContainer (org.jenkinsci.test.acceptance.docker.DockerContainer)1 Resource (org.jenkinsci.test.acceptance.junit.Resource)1 SmokeTest (org.jenkinsci.test.acceptance.junit.SmokeTest)1 TestActivation (org.jenkinsci.test.acceptance.junit.TestActivation)1 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)1 CredentialsPage (org.jenkinsci.test.acceptance.plugins.credentials.CredentialsPage)1