use of org.jenkinsci.test.acceptance.po.ArtifactArchiver in project acceptance-test-harness by jenkinsci.
the class FreestyleJobTest method archiveArtifacts.
@Test
@Category(SmokeTest.class)
public void archiveArtifacts() {
FreeStyleJob j = jenkins.jobs.create(FreeStyleJob.class);
j.configure();
j.addShellStep("echo 'yes' > include; echo 'no' > exclude;");
ArtifactArchiver archiver = j.addPublisher(ArtifactArchiver.class);
archiver.includes("**/*include*");
archiver.excludes("exclude");
j.save();
Build build = j.scheduleBuild().waitUntilFinished();
assertThat(build.getArtifact("exclude"), pageObjectDoesNotExist());
Artifact include = build.getArtifact("include");
assertThat(include, pageObjectExists());
assertThat(include.getTextContent(), equalTo("yes"));
}
use of org.jenkinsci.test.acceptance.po.ArtifactArchiver in project acceptance-test-harness by jenkinsci.
the class ParameterizedTriggerTest method triggerWithNonStandardArchiver.
@Test
@WithPlugins({ "compress-artifacts", "matrix-project" /*JENKINS-33910*/
})
@Issue("JENKINS-28980")
public void triggerWithNonStandardArchiver() {
CompressingArtifactManager.setup(jenkins);
FreeStyleJob target = jenkins.jobs.create();
target.configure();
target.addParameter(StringParameter.class).setName("PARAM");
target.addShellStep("test 'value' = $PARAM");
target.save();
FreeStyleJob trigger = jenkins.jobs.create();
trigger.configure();
trigger.addShellStep("echo 'PARAM=value' > my.properties");
ArtifactArchiver archiver = trigger.addPublisher(ArtifactArchiver.class);
archiver.includes("my.properties");
ParameterizedTrigger step = trigger.addPublisher(ParameterizedTrigger.class);
TriggerConfig config = step.getTriggerConfig(0);
config.projects.set(target.name);
FileBuildParameters params = config.addParameter(FileBuildParameters.class);
params.file.set("my.properties");
params.failIfMissing.check();
trigger.save();
trigger.startBuild().shouldSucceed();
Build downstream = target.build(1);
downstream.shouldSucceed();
}
use of org.jenkinsci.test.acceptance.po.ArtifactArchiver in project acceptance-test-harness by jenkinsci.
the class PublisherOrderTest method testOrdered.
@Test
public void testOrdered() {
FreeStyleJob upstream = jenkins.jobs.create(FreeStyleJob.class);
upstream.configure();
String command = "echo 'hello' > aggregate.txt";
if (SystemUtils.IS_OS_UNIX) {
upstream.addShellStep(command);
} else {
upstream.addBatchStep(command);
}
AggregateDownstreamTestResults aggregate = upstream.addPublisher(AggregateDownstreamTestResults.class);
aggregate.specify.check();
ArtifactArchiver archiver = upstream.addPublisher(ArtifactArchiver.class);
archiver.includes("aggregate.txt");
BuildTrigger trigger = upstream.addPublisher(BuildTrigger.class);
trigger.childProjects.set("projectName");
Fingerprint fingerprint = upstream.addPublisher(Fingerprint.class);
fingerprint.targets.set("aggregate.txt");
upstream.save();
}
use of org.jenkinsci.test.acceptance.po.ArtifactArchiver in project acceptance-test-harness by jenkinsci.
the class PublisherOrderTest method testUnordered.
@Test
public void testUnordered() {
FreeStyleJob upstream = jenkins.jobs.create(FreeStyleJob.class);
upstream.configure();
String command = "echo 'hello' > aggregate.txt";
if (SystemUtils.IS_OS_UNIX) {
upstream.addShellStep(command);
} else {
upstream.addBatchStep(command);
}
ArtifactArchiver archiver = upstream.addPublisher(ArtifactArchiver.class);
archiver.includes("aggregate.txt");
BuildTrigger trigger = upstream.addPublisher(BuildTrigger.class);
trigger.childProjects.set("projectName");
Fingerprint fingerprint = upstream.addPublisher(Fingerprint.class);
fingerprint.targets.set("aggregate.txt");
AggregateDownstreamTestResults aggregate = upstream.addPublisher(AggregateDownstreamTestResults.class);
aggregate.specify.check();
fingerprint.targets.set("another.txt");
upstream.save();
upstream.configure();
archiver.includes("another.txt");
JUnitPublisher junit = upstream.addPublisher(JUnitPublisher.class);
fingerprint.targets.set("yetanother");
}
Aggregations