use of org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_collect_warnings_of_selected_tools_only.
/**
* Verifies that the plugin only collects warnings of the checked plugins. The test starts with a build that
* collects the warnings of all available tools. Then subsequently a new build is started with one tool removed
* until no tool is checked anymore.
*/
@Test
public void should_collect_warnings_of_selected_tools_only() {
FreeStyleJob job = createFreeStyleJob();
int remaining = TOTAL;
AnalysisCollectorAction action = deselectPluginAndBuild(CHECKSTYLE, job);
remaining -= CHECKSTYLE_ALL;
assertThat(action.getNumberOfWarnings(), is(remaining));
action = deselectPluginAndBuild(FINDBUGS, job);
remaining -= FINDBUGS_ALL;
assertThat(action.getNumberOfWarnings(), is(remaining));
action = deselectPluginAndBuild(PMD, job);
remaining -= PMD_ALL;
assertThat(action.getNumberOfWarnings(), is(remaining));
action = deselectPluginAndBuild(TASKS, job);
remaining -= TASKS_ALL;
assertThat(action.getNumberOfWarnings(), is(remaining));
action = deselectPluginAndBuild(WARNINGS, job);
assertThat(action.getNumberOfWarnings(), is(0));
}
use of org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_compute_all_new_open_tasks.
/**
* Verifies that the plugin correctly identifies new open tasks. The first build contains 4 open tasks. The second
* builds adds another 4 open tasks, summing up to a total of 8 open tasks. The second build should then contain 4
* new warnings.
*/
@Test
public void should_compute_all_new_open_tasks() {
FreeStyleJob job = createJob(ANALYSIS_COLLECTOR_PLUGIN_RESOURCES + "/Tasks.java", true);
buildSuccessfulJob(job);
job.configure();
job.copyResource(ANALYSIS_COLLECTOR_PLUGIN_RESOURCES + "/Tasks2.java");
job.save();
Build build = buildSuccessfulJob(job);
AnalysisCollectorAction action = new AnalysisCollectorAction(build);
action.open();
assertThat(action.getNumberOfWarnings(), is(8));
assertThat(action.getNumberOfWarningsWithHighPriority(), is(2));
assertThat(action.getNumberOfWarningsWithNormalPriority(), is(4));
assertThat(action.getNumberOfWarningsWithLowPriority(), is(2));
assertThat(action.getNumberOfNewWarnings(), is(4));
}
use of org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method deselectPluginAndBuild.
private AnalysisCollectorAction deselectPluginAndBuild(AnalysisPlugin plugin, Job job) {
job.configure();
AnalysisCollectorSettings publisher = job.getPublisher(AnalysisCollectorSettings.class);
publisher.checkCollectedPlugin(plugin, false);
job.save();
Build build = buildSuccessfulJob(job);
AnalysisCollectorAction action = new AnalysisCollectorAction(build);
action.open();
return action;
}
use of org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction 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.plugins.analysis_collector.AnalysisCollectorAction in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_deactivate_all_other_trend_graphs.
/**
* Verifies that no other trend graphs are shown if configured in the graph configuration screen per user.
*/
@Test
@Issue("JENKINS-30270")
public void should_deactivate_all_other_trend_graphs() {
FreeStyleJob job = createFreeStyleJob();
buildSuccessfulJob(job);
buildSuccessfulJob(job);
job.open();
elasticSleep(500);
assertThatNumberOfGraphsIs(job, 48);
AnalysisCollectorAction action = new AnalysisCollectorAction(job);
AnalysisGraphConfigurationView view = action.configureTrendGraphForUser();
deactivateOtherTrendGraphs(view, true);
assertThatNumberOfGraphsIs(job, 6);
deactivateOtherTrendGraphs(view, false);
assertThatNumberOfGraphsIs(job, 48);
}
Aggregations