use of org.jenkinsci.plugins.configfiles.GlobalConfigFiles in project promoted-builds-plugin by jenkinsci.
the class PromotionConfigFilesTest method testPromotionConfigFilesAreRetrievedFromParentJobContext.
@Test
public void testPromotionConfigFilesAreRetrievedFromParentJobContext() throws Exception {
GlobalConfigFiles store = r.getInstance().getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
Assert.assertTrue(store.getConfigs().isEmpty());
CustomConfig config = new CustomConfig(CONFIG_ID, "name", "comment", "content");
store.save(config);
FreeStyleProject p = r.createFreeStyleProject();
// promote if the downstream passes
JobPropertyImpl promotion = new JobPropertyImpl(p);
p.addProperty(promotion);
PromotionProcess promo1 = promotion.addProcess("promo1");
promo1.conditions.add(new SelfPromotionCondition(false));
List<ManagedFile> managedFiles = new ArrayList<>();
managedFiles.add(new ManagedFile(CONFIG_ID));
promo1.getBuildSteps().add(new ConfigFileBuildStep(managedFiles));
r.assertBuildStatusSuccess(p.scheduleBuild2(0));
// internally, the promotion is still an asynchronous process. It just happens
// right away after the build is complete.
Thread.sleep(1000);
Promotion pb = promo1.getBuilds().iterator().next();
assertEquals(Result.SUCCESS, pb.getResult());
}
use of org.jenkinsci.plugins.configfiles.GlobalConfigFiles in project nodejs-plugin by jenkinsci.
the class NodeJSBuildWrapperTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
Config config = new NPMConfig(id, null, null, content, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
use of org.jenkinsci.plugins.configfiles.GlobalConfigFiles in project nodejs-plugin by jenkinsci.
the class NodeJSCommandInterpreterTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
Config config = new NPMConfig(id, null, null, content, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
use of org.jenkinsci.plugins.configfiles.GlobalConfigFiles in project nodejs-plugin by jenkinsci.
the class NpmrcFileSupplyTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
Config config = new NPMConfig(id, null, null, content, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
Aggregations