Search in sources :

Example 86 with SvnMaterialConfig

use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.

the class PipelineWithTwoStages method addToSetup.

public void addToSetup() throws Exception {
    TestRepo svnTestRepo = new SvnTestRepo(tempDir);
    svnClient = new SvnCommand(null, svnTestRepo.projectRepositoryUrl());
    MaterialConfigs materialConfigs = MaterialConfigsMother.mockMaterialConfigs(svnTestRepo.projectRepositoryUrl());
    SvnMaterialConfig svnMaterialConfig = (SvnMaterialConfig) materialConfigs.first();
    svnMaterialConfig.setName(new CaseInsensitiveString(DEFAULT_MATERIAL));
    svnMaterialConfig.setConfigAttributes(Collections.singletonMap(ScmMaterialConfig.FOLDER, "default-folder"));
    configHelper.addPipelineWithGroup(groupName, pipelineName, materialConfigs, devStage, jobsOfDevStage);
    configHelper.addStageToPipeline(pipelineName, ftStage, JOB_FOR_FT_STAGE);
    configHelper.setPipelineLabelTemplate(pipelineName, "label-${COUNT}");
    dbHelper.onSetUp();
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) SvnTestRepo(com.thoughtworks.go.helper.SvnTestRepo) TestRepo(com.thoughtworks.go.helper.TestRepo) SvnCommand(com.thoughtworks.go.domain.materials.svn.SvnCommand) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString)

Example 87 with SvnMaterialConfig

use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.

the class MaterialUpdateServiceIntegrationTest method shouldClearServerHealthLogsForMaterialThatNoLongerExistsInCruiseConfig.

@Test
public void shouldClearServerHealthLogsForMaterialThatNoLongerExistsInCruiseConfig() throws Exception {
    HealthStateScope badScope = HealthStateScope.forMaterial(new SvnMaterial("non-existent-url!", "user", "pwd", false));
    serverHealthService.update(ServerHealthState.error("where's the material!", "fubar", HealthStateType.general(badScope)));
    SvnMaterialConfig goodMaterial = svn("good-url!", "user", "pwd", false);
    HealthStateScope goodScope = HealthStateScope.forMaterialConfig(goodMaterial);
    serverHealthService.update(ServerHealthState.error("could not update!", "why", HealthStateType.general(goodScope)));
    MaterialUpdateService materialUpdateService = new MaterialUpdateService(null, null, mock(MaterialUpdateCompletedTopic.class), mock(GoConfigWatchList.class), mock(GoConfigService.class), systemEnvironment, serverHealthService, null, mock(MDUPerformanceLogger.class), materialConfigConverter, null, maintenanceModeService, null, null);
    materialUpdateService.onConfigChange(configWithMaterial(goodMaterial));
    assertThat(serverHealthService, ServerHealthMatcher.containsState(HealthStateType.general(goodScope)));
}
Also used : HealthStateScope(com.thoughtworks.go.serverhealth.HealthStateScope) MDUPerformanceLogger(com.thoughtworks.go.server.perf.MDUPerformanceLogger) GoConfigWatchList(com.thoughtworks.go.config.GoConfigWatchList) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) Test(org.junit.jupiter.api.Test)

Example 88 with SvnMaterialConfig

use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.

the class BuildCauseProducerServiceWithFlipModificationTest method shouldMarkModificationChangedAsTrueIfMaterialsChanged.

@Test
public void shouldMarkModificationChangedAsTrueIfMaterialsChanged() throws Exception {
    SvnMaterialConfig svnMaterialConfig = setUpPipelineWithTwoMaterials();
    scheduleHelper.autoSchedulePipelinesWithRealMaterials(PIPELINE_NAME);
    consume(buildCauseForPipeline());
    configHelper.replaceMaterialForPipeline(PIPELINE_NAME, svnMaterialConfig);
    scheduleHelper.autoSchedulePipelinesWithRealMaterials(PIPELINE_NAME);
    verifyBuildCauseHasModificationsWith(pipelineScheduleQueue.toBeScheduled(), true);
}
Also used : SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Test(org.junit.jupiter.api.Test)

Example 89 with SvnMaterialConfig

use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.

the class MaterialExpansionServiceCachingTest method shouldExpandSvnMaterialWithExternalsIntoMultipleSvnMaterialsWhenExpandingForScheduling.

@Test
public void shouldExpandSvnMaterialWithExternalsIntoMultipleSvnMaterialsWhenExpandingForScheduling() {
    SvnMaterialConfig svnMaterialConfig = svnMaterialConfig(svnRepo.projectRepositoryUrl(), "mainRepo");
    MaterialConfigs materialConfigs = new MaterialConfigs();
    materialExpansionService.expandForScheduling(svnMaterialConfig, materialConfigs);
    assertThat(materialConfigs.size(), is(2));
    assertThat(materialConfigs.get(0), is(svnMaterialConfig));
    assertThat(((SvnMaterialConfig) materialConfigs.get(1)).getUrl(), endsWith("end2end/"));
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Test(org.junit.jupiter.api.Test)

Example 90 with SvnMaterialConfig

use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.

the class ScheduledPipelineLoaderIntegrationTest method shouldSetPasswordForExpandedSvnMaterial.

// if other materials have expansion concept at some point, add more tests here
@Test
public void shouldSetPasswordForExpandedSvnMaterial() {
    JobConfig jobConfig = new JobConfig("job-one");
    jobConfig.addTask(new AntTask());
    PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("last", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(jobConfig)));
    pipelineConfig.materialConfigs().clear();
    SvnMaterialConfig materialConfig = svnRepo.materialConfig();
    materialConfig.setConfigAttributes(Collections.singletonMap(SvnMaterialConfig.CHECK_EXTERNALS, String.valueOf(true)));
    materialConfig.setPassword("boozer");
    pipelineConfig.addMaterialConfig(materialConfig);
    configHelper.addPipeline(pipelineConfig);
    Pipeline loadedPipeline = createAndLoadModifyOneFilePipeline(pipelineConfig);
    MaterialRevisions revisions = loadedPipeline.getBuildCause().getMaterialRevisions();
    assertThat(revisions.getRevisions().size(), is(2));
    assertThat(((SvnMaterial) revisions.getRevisions().get(0).getMaterial()).getPassword(), is("boozer"));
    assertThat(((SvnMaterial) revisions.getRevisions().get(1).getMaterial()).getPassword(), is("boozer"));
}
Also used : SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) Test(org.junit.jupiter.api.Test)

Aggregations

SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)92 Test (org.junit.jupiter.api.Test)60 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)25 P4MaterialConfig (com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)15 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)12 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)11 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)11 GoCipher (com.thoughtworks.go.security.GoCipher)11 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)9 PluggableSCMMaterialConfig (com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig)9 TfsMaterialConfig (com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig)8 Test (org.junit.Test)8 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)7 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)6 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)5 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)4 SvnCommand (com.thoughtworks.go.domain.materials.svn.SvnCommand)4 SCMs (com.thoughtworks.go.domain.scm.SCMs)3 GoConfigMother (com.thoughtworks.go.helper.GoConfigMother)3 SvnTestRepo (com.thoughtworks.go.helper.SvnTestRepo)3