use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class JUnitPluginTest method publish_test_result_which_passed.
@Test
public void publish_test_result_which_passed() {
FreeStyleJob j = jenkins.jobs.create();
j.configure();
j.copyResource(resource("/junit/success/com.simple.project.AppTest.txt"));
j.copyResource(resource("/junit/success/TEST-com.simple.project.AppTest.xml"));
j.addPublisher(JUnitPublisher.class).testResults.set("*.xml");
j.save();
j.startBuild().shouldSucceed().open();
clickLink("Test Result");
assertThat(driver, hasContent("0 failures"));
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class JacocoPluginTest method checkSuccessfulExecutionAndsummary.
@Test
public void checkSuccessfulExecutionAndsummary() {
MavenInstallation.installSomeMaven(jenkins);
FreeStyleJob job = jenkins.jobs.create();
{
job.copyDir(resource("/jacoco/test"));
MavenBuildStep maven = job.addBuildStep(MavenBuildStep.class);
maven.targets.set("clean package -B");
maven.properties("jacoco.version=" + getJacocoLibraryVersion(), true);
JacocoPublisher publisher = job.addPublisher(JacocoPublisher.class);
publisher.changeBuildStatus.check();
}
job.save();
Build build = job.startBuild().waitUntilFinished().shouldSucceed();
assertThat(build, hasAction("Coverage Report"));
JacocoResultPage total = new JacocoResultPage(build);
assertEquals(45.45, total.instructionCoverage(), 0.01);
assertEquals(50.0, total.branchCoverage(), 0.01);
assertEquals(33.33, total.complexityScore(), 0.01);
assertEquals(50.0, total.lineCoverage(), 0.01);
assertEquals(50.0, total.methodCoverage(), 0.01);
assertEquals(100.0, total.classCoverage(), 0.01);
JacocoResultPage pkg = new JacocoResultPage(total, "(default)/App");
assertEquals(45.45, pkg.instructionCoverage(), 0.01);
assertEquals(50.0, pkg.branchCoverage(), 0.01);
assertEquals(33.33, pkg.complexityScore(), 0.01);
assertEquals(50.0, pkg.lineCoverage(), 0.01);
assertEquals(50.0, pkg.methodCoverage(), 0.01);
assertEquals(100.0, pkg.classCoverage(), 0.01);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class ArtifactoryPluginTest method gradle_integration.
@Test
@WithPlugins("gradle")
@Ignore
@Issue("JENKINS-39323")
public void gradle_integration() {
final ArtifactoryContainer artifactory = artifactoryContainer.get();
waitForArtifactory(artifactory);
configureArtifactory(artifactory);
GradleInstallation.installGradle(jenkins, "gradle 2.0", "2.0");
FreeStyleJob job = jenkins.jobs.create();
job.copyDir(resource("/artifactory_plugin/quickstart"));
ArtifactoryGradleConfiguratior gradleConfig = new ArtifactoryGradleConfiguratior(job);
gradleConfig.refresh();
GradleStep gradle = job.addBuildStep(GradleStep.class);
gradle.setVersion("gradle 2.0");
// gradle.tasks.set("build --stacktrace --debug");
gradle.setTasks("build");
job.save();
Build build = job.startBuild().shouldSucceed();
String log = build.getConsole();
assertThat(log, containsString("build artifactoryPublish"));
assertThat(log, containsString("[buildinfo]"));
assertThat(log, containsString("Deploying artifact"));
assertThat(log, containsRegexp("Deploying build (info|descriptor) to: " + artifactory.getURL() + "/api/build"));
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class CoberturaPluginTest method setupJob.
private FreeStyleJob setupJob() {
FreeStyleJob j = jenkins.jobs.create();
j.configure();
{
j.copyResource(resource("/cobertura_plugin/coverage.xml"));
CoberturaPublisher c = j.addPublisher(CoberturaPublisher.class);
c.reportFile.set("coverage.xml");
}
j.save();
return j;
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class JavadocPluginTest method validate_javadoc_retention.
@Test
public void validate_javadoc_retention() {
FreeStyleJob job = jenkins.jobs.create();
setup(job);
Build b = job.startBuild().shouldSucceed();
assertThat(job, hasAction(JAVADOC_ACTION));
assertThat("Build #1 should not have Javadoc action", b, not(hasAction(JAVADOC_ACTION)));
this.setupForRetention(job);
b = job.startBuild().shouldSucceed();
assertThat(job, hasAction(JAVADOC_ACTION));
assertThat(b, hasAction(JAVADOC_ACTION));
}
Aggregations