use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class MavenPluginTest method useWithTasks.
@Issue("JENKINS-22252")
@WithPlugins({ "maven-plugin@2.12", "tasks" })
@Test
public void useWithTasks() throws InterruptedException {
MavenInstallation.installMaven(jenkins, "Maven 3.2.x", "3.2.1");
MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
job.configure();
job.copyDir(resource("/maven_plugin/multimodule/"));
job.goals.set("package");
job.addBuildSettings(TasksMavenSettings.class);
job.save();
Build build = job.startBuild().shouldSucceed();
assertThat(build.getConsole(), not(containsString("IllegalAccessError")));
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_find_warnings_without_sleep.
/**
* Runs a pipeline script that compiles a file with some warnings. The warnings plug-in should find all
* 6 warnings.
*/
@Test
@WithPlugins("workflow-aggregator")
@Issue("32191")
@Ignore("Exposes bug JENKINS-32191")
public void should_find_warnings_without_sleep() {
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
job.script.set("node {\n" + " writeFile(file: \"a.c\", text: '''\n" + "#include <sys/types.h>\n" + "#include <stdlib.h>\n" + "\n" + "void\n" + "func1(void)\n" + "{\n" + "}\n" + "\n" + "int\n" + "main(int argc, char *argv[])\n" + "{\n" + " char *a;\n" + " int64_t *b;\n" + " b = (int64_t *)a;\n" + " printf(\"Hi\");\n" + " printf(NULL);\n" + " printf(\"%s %d\\\\n\", \"35\");\n" + " func1();\n" + "}\n" + "'''\n" + " )\n" + " sh \"cc -Wall -W -Wcast-align -o output a.c\"\n" + " step([$class: 'WarningsPublisher',\n" + " canComputeNew: false,\n" + " canResolveRelativePaths: false,\n" + " consoleParsers: [[parserName: 'Clang (LLVM based)']],\n" + " defaultEncoding: '',\n" + " excludePattern: '',\n" + " healthy: '',\n" + " includePattern: '',\n" + " messagesPattern: '',\n" + " unHealthy: ''])\n" + "}\n");
job.sandbox.check();
job.save();
Build build = buildSuccessfulJob(job);
assertThatActionExists(job, build, "LLVM/Clang Warnings");
build.open();
Pattern warnings = Pattern.compile("LLVM/Clang Warnings: ([1-9][0-9]*)");
// some warnings, number depends on actual compiler version
assertThat(driver, hasContent(warnings));
int actualWarnings = extractWarningsCountFromPage(warnings);
buildSuccessfulJob(job);
// FIXME: move to verify trend graph
job.open();
verifyTrendGraph(job, actualWarnings);
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class TSRCreateSlaveTest method newSlaveWithExistingCredential.
@Test
@WithPlugins("credentials@2.0.7")
public void newSlaveWithExistingCredential() throws Exception {
String username = "xyz";
String description = "SSH Key setup";
String privateKey = "1212121122121212";
CredentialsPage c = new CredentialsPage(jenkins, "_");
c.open();
SshPrivateKeyCredential sc = c.add(SshPrivateKeyCredential.class);
sc.username.set(username);
sc.description.set(description);
sc.selectEnterDirectly().privateKey.set(privateKey);
c.create();
// now verify
c.open();
ManagedCredentials mc = new ManagedCredentials(jenkins);
String href = mc.credentialById("ssh_creds");
c.setConfigUrl(href);
verifyValueForCredential(c, sc.username, username);
verifyValueForCredential(c, sc.selectEnterDirectly().privateKey, privateKey);
// Just to make sure the dumb slave is set up properly, we should seed it
// with a FS root and executors
final DumbSlave s = jenkins.slaves.create(DumbSlave.class);
SshSlaveLauncher l = s.setLauncher(SshSlaveLauncher.class);
l.host.set("127.0.0.1");
l.credentialsId.select(String.format("%s (%s)", username, description));
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method should_show_warnings_in_folder.
/**
* Sets up a nested view that contains a dashboard view with a warnings-per-project portlet.
* Creates a folder in this view and a freestyle job in this folder.
* Finally checks if the warnings-per-project portlet and warnings column show the
* correct number of warnings and provide a direct link to the actual warning results.
*/
@Test
@Issue("JENKINS-39947")
@WithPlugins({ "dashboard-view", "nested-view", "cloudbees-folder", "analysis-core@1.87" })
public void should_show_warnings_in_folder() {
// avoid JENKINS-49026
checkExtensionAreDeployed("hudson.plugins.analysis.dashboard.AbstractPortlet", Collections.EMPTY_SET);
NestedView nested = jenkins.getViews().create(NestedView.class);
DashboardView dashboard = nested.getViews().create(DashboardView.class);
dashboard.configure(() -> {
dashboard.matchAllJobs();
dashboard.checkRecurseIntoFolders();
});
Folder folder = dashboard.jobs.create(Folder.class);
folder.save();
folder.open();
FreeStyleJob job = createFreeStyleJob(folder);
runAndVerifyJobResults(job);
P projectAction = createProjectAction(job);
dashboard.configure(() -> {
dashboard.addBottomPortlet(projectAction.getTablePortlet());
});
verifyPortlet(projectAction);
addListViewColumn(projectAction.getViewColumn(), folder);
verifyColumn(projectAction);
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method should_show_warning_totals_in_dashboard_portlet_with_link_to_results.
/**
* Sets up a dashboard view with a warnings-per-project portlet. Builds a job and checks if the portlet shows the
* correct number of warnings and provides a direct link to the actual warning results.
*/
@Test
@WithPlugins("dashboard-view")
public void should_show_warning_totals_in_dashboard_portlet_with_link_to_results() {
// avoid JENKINS-49026
checkExtensionAreDeployed("hudson.plugins.analysis.dashboard.AbstractPortlet", Collections.EMPTY_SET);
FreeStyleJob job = createFreeStyleJob();
buildJobAndWait(job).shouldSucceed();
P projectAction = createProjectAction(job);
addDashboardViewAndBottomPortlet(projectAction.getTablePortlet(), jenkins);
verifyPortlet(projectAction);
}
Aggregations