use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class GradlePluginTest method run_gradle_pipeline_build_task_links.
/**
* Runs a pipeline gradle build and verifies that the task links are existent
*/
@Test
@WithPlugins("workflow-aggregator")
@Ignore("JENKINS-45206")
public void run_gradle_pipeline_build_task_links() {
final Build build = setUpAndRunPipelineBuild(JENKINS_FILE_MULTIPLE_TASKS, GRADLE_SCRIPT);
final WebElement firstTaskLink = build.find(By.partialLinkText(FIRST.getName()));
final WebElement secondTaskLink = build.find(By.partialLinkText(SECOND.getName()));
assertThat(firstTaskLink.getAttribute("href"), containsString("#gradle-task-0"));
assertThat(secondTaskLink.getAttribute("href"), containsString("#gradle-task-1"));
assertThat(build.getConsole(), containsString(FIRST.getPrintln()));
assertThat(build.getConsole(), containsString(SECOND.getPrintln()));
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins 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.WithPlugins in project acceptance-test-harness by jenkinsci.
the class SAMLPluginTest method authenticationOKPostBinding.
@Test
@WithDocker
@WithPlugins({ "saml", "matrix-auth" })
public void authenticationOKPostBinding() throws IOException, InterruptedException {
// navigate to root
jenkins.open();
String rootUrl = jenkins.getCurrentUrl();
SAMLContainer samlServer = startSimpleSAML(rootUrl);
GlobalSecurityConfig sc = new GlobalSecurityConfig(jenkins);
sc.open();
// Authentication
SamlSecurityRealm realm = configureBasicSettings(sc);
String idpMetadata = readIdPMetadataFromURL(samlServer);
realm.setXml(idpMetadata);
realm.setBinding(SAML2_POST_BINDING_URI);
configureEncrytion(realm);
configureAuthorization(sc);
// SAML service login page
waitFor().withTimeout(10, TimeUnit.SECONDS).until(() -> hasContent("Enter your username and password"));
// SAML server login
makeLoginWithUser1();
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_send_mail_with_expanded_tokens.
/**
* Checks that the plug-in sends a mail after a build has been failed. The content of the mail contains several
* tokens that should be expanded in the mail with the correct values.
*/
// TODO: check if we can remove this test since a similar one in parent
@Test
@Issue("25501")
@WithPlugins("email-ext")
public void should_send_mail_with_expanded_tokens() {
// avoid JENKINS-49026
checkExtensionAreDeployed("hudson.plugins.analysis.tokens.AbstractTokenMacro", Sets.newHashSet("hudson.plugins.warnings.tokens.WarningsResultTokenMacro"));
setUpMailer();
FreeStyleJob job = createFreeStyleJob(settings -> {
settings.addWorkspaceScanner(JAVA_TITLE, "**/*");
settings.addWorkspaceScanner(MS_BUILD_ID, "**/*");
});
buildSuccessfulJob(job);
editJob(job, WarningsBuildSettings.class, settings -> {
settings.addWorkspaceScanner(JAVA_DOC_ID, "**/*");
settings.setExcludePattern(".*Catalyst.*");
settings.setBuildFailedTotalAll("0");
});
configureEmailNotification(job, "Warnings: ${WARNINGS_RESULT}", "Warnings: ${WARNINGS_COUNT}-${WARNINGS_FIXED}-${WARNINGS_NEW}");
buildFailingJob(job);
verifyReceivedMail("Warnings: FAILURE", "Warnings: 142-12-8");
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins 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");
}
Aggregations