use of org.jenkinsci.test.acceptance.po.WorkflowJob in project acceptance-test-harness by jenkinsci.
the class TaskScannerPluginTest method createPipeline.
@Override
protected WorkflowJob createPipeline() {
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
String[] files = { "TSRBuildTimeoutPluginTest.java", "TSRCleaner.java", "TSRCreateSlaveTest.java", "TSRDockerImage.java", "TSREc2Provider.java", "TSRGitRepo.java", "TSRJenkinsAcceptanceTestRule.java", "TSRTestCleaner.java", "TSRWinstoneDockerController.java" };
StringBuilder copyFilesWithTasks = new StringBuilder();
for (String file : files) {
copyFilesWithTasks.append(job.copyResourceStep(TASKS_FILES + "/" + file));
}
job.script.set("node {\n" + copyFilesWithTasks.toString() + " step([$class: 'TasksPublisher', high: 'FIXME', normal: 'TODO', low: '@Deprecated'," + "excludePattern: '**/*Test.java'])\n}");
job.sandbox.check();
job.save();
return job;
}
use of org.jenkinsci.test.acceptance.po.WorkflowJob in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method createPipeline.
@Override
protected WorkflowJob createPipeline() {
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
job.script.set("node {\n" + job.copyResourceStep(SEVERAL_PARSERS_FILE_FULL_PATH) + " step([$class: 'WarningsPublisher', " + " parserConfigurations: [" + " [parserName: 'Java Compiler (javac)', pattern: '**/warningsAll.txt']," + " ]])\n}");
job.sandbox.check();
job.save();
return job;
}
use of org.jenkinsci.test.acceptance.po.WorkflowJob 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.po.WorkflowJob in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_compute_annotations_on_workflow.
@Test
@WithPlugins("workflow-aggregator")
public void should_compute_annotations_on_workflow() {
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
job.script.set("node {\n" + copyFileToWorkspace(job, "checkstyle-result.xml") + copyFileToWorkspace(job, "findbugs.xml") + " step([$class: 'FindBugsPublisher', pattern: '**/findbugs.xml'])\n" + " step([$class: 'CheckStylePublisher'])\n" + " step([$class: 'AnalysisPublisher'])\n" + "}");
job.sandbox.check();
job.save();
final Build build = job.startBuild();
build.shouldSucceed();
assertThat(build, hasAction("Static Analysis Warnings"));
AnalysisCollectorAction action = new AnalysisCollectorAction(build);
action.open();
assertThat(action.getNumberOfWarnings(), is(FINDBUGS_ALL + CHECKSTYLE_ALL));
assertThat(action.getNumberOfNewWarnings(), is(FINDBUGS_ALL + CHECKSTYLE_ALL));
}
use of org.jenkinsci.test.acceptance.po.WorkflowJob in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method buildBranch.
private WorkflowJob buildBranch(WorkflowMultiBranchJob job, String branchName) {
WorkflowJob master = job.getJob(branchName);
master.build(1).waitUntilFinished().shouldSucceed();
return master;
}
Aggregations