use of org.jenkinsci.test.acceptance.junit.WithCredentials 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)));
}
use of org.jenkinsci.test.acceptance.junit.WithCredentials in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method provisionSshSlaveWithPasswdAuthRetryOnFailedAuth.
@Test
@WithCredentials(credentialType = WithCredentials.USERNAME_PASSWORD, values = { MACHINE_USERNAME, "ath" })
@TestActivation({ "HARDWARE_ID", "IMAGE_ID", "KEY_PAIR_NAME", "NETWORK_ID" })
public void provisionSshSlaveWithPasswdAuthRetryOnFailedAuth() {
configureCloudInit("cloud-init-authfix");
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.junit.WithCredentials in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method detailsTabContentWithOneWarningTest.
@Test
@WithDocker
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { CREDENTIALS_ID, CREDENTIALS_KEY })
@WithPlugins("ssh-slaves")
public void detailsTabContentWithOneWarningTest() throws ExecutionException, InterruptedException {
WarningsAction action = createAndBuildCompileJobOnAgent(resource("/warnings_plugin/WarningMain2.java"), "javac -Xlint:all WarningMain2.java");
SortedMap<String, String> details = action.getDetailsTabContents();
assertThat("Assert the proper detail count.", details.entrySet(), hasSize(1));
assertThatDetailsAre(details, "redundant cast to TextClass", "WarningMain2.java:9");
}
use of org.jenkinsci.test.acceptance.junit.WithCredentials in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_scan_files_on_slave.
@Test
@WithDocker
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { CREDENTIALS_ID, CREDENTIALS_KEY })
@WithPlugins("ssh-slaves")
public void should_scan_files_on_slave() {
DumbSlave dockerSlave = createDockerAgent();
FreeStyleJob job = prepareDockerSlave(dockerSlave);
job.configure();
job.copyResource(resource("/warnings_plugin/out.txt"));
job.addPublisher(WarningsPublisher.class).addWorkspaceFileScanner(JAVA_ID, "out.txt");
job.save();
Build build = job.startBuild().shouldSucceed();
assertThatActionExists(job, build, "Java Warnings");
build.open();
assertThat(driver, hasContent("Java Warnings: " + 2));
}
use of org.jenkinsci.test.acceptance.junit.WithCredentials in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_have_correct_details.
@Test
@WithDocker
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { CREDENTIALS_ID, CREDENTIALS_KEY })
@WithPlugins("ssh-slaves")
public void should_have_correct_details() throws ExecutionException, InterruptedException {
WarningsAction action = createAndBuildCompileJobOnAgent(resource("/warnings_plugin/WarningMain.java"), "javac -Xlint:all WarningMain.java");
SortedMap<String, String> details = action.getDetailsTabContents();
assertThat("Assert the proper detail count.", details.entrySet(), hasSize(3));
assertThatDetailsAre(details, "redundant cast to TextClass", "WarningMain.java:10");
// removing tested entry from details.
details.remove(details.firstKey());
assertThatDetailsAre(details, "redundant cast to TextClass", "WarningMain.java:11");
// removing tested entry from details.
details.remove(details.firstKey());
assertThatDetailsAre(details, "division by zero", "WarningMain.java:14");
}
Aggregations