Search in sources :

Example 1 with ParameterizedTrigger

use of org.jenkinsci.test.acceptance.plugins.parameterized_trigger.ParameterizedTrigger 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();
}
Also used : StringParameter(org.jenkinsci.test.acceptance.po.StringParameter) ParameterizedTrigger(org.jenkinsci.test.acceptance.plugins.parameterized_trigger.ParameterizedTrigger) ArtifactArchiver(org.jenkinsci.test.acceptance.po.ArtifactArchiver) Build(org.jenkinsci.test.acceptance.po.Build) TriggerConfig(org.jenkinsci.test.acceptance.plugins.parameterized_trigger.TriggerConfig) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) FileBuildParameters(org.jenkinsci.test.acceptance.plugins.parameterized_trigger.FileBuildParameters) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)1 FileBuildParameters (org.jenkinsci.test.acceptance.plugins.parameterized_trigger.FileBuildParameters)1 ParameterizedTrigger (org.jenkinsci.test.acceptance.plugins.parameterized_trigger.ParameterizedTrigger)1 TriggerConfig (org.jenkinsci.test.acceptance.plugins.parameterized_trigger.TriggerConfig)1 ArtifactArchiver (org.jenkinsci.test.acceptance.po.ArtifactArchiver)1 Build (org.jenkinsci.test.acceptance.po.Build)1 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)1 StringParameter (org.jenkinsci.test.acceptance.po.StringParameter)1 Test (org.junit.Test)1 Issue (org.jvnet.hudson.test.Issue)1