Search in sources :

Example 36 with BuildConfiguration

use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.

the class BuildExecutionTest method shouldNotContinueBuildOnMavenError.

@Test
public void shouldNotContinueBuildOnMavenError() throws ExecutorException, InterruptedException, TimeoutException {
    BuildConfiguration buildConfiguration = configurationBuilder.buildFailingConfiguration(3, "build-failed-on-maven", null);
    Set<BuildExecutionStatusChangedEvent> statusChangedEvents = new HashSet<>();
    ObjectWrapper<BuildResult> buildExecutionResultWrapper = new ObjectWrapper<>();
    runBuild(buildConfiguration, statusChangedEvents, buildExecutionResultWrapper);
    checkBuildStatuses(statusChangedEvents, Arrays.asList(DONE_WITH_ERRORS, BUILD_ENV_DESTROYED, BUILD_ENV_DESTROYING));
    assertNoState(statusChangedEvents, BuildExecutionStatus.COLLECTING_RESULTS_FROM_REPOSITORY_MANAGER);
}
Also used : BuildConfiguration(org.jboss.pnc.model.BuildConfiguration) BuildResult(org.jboss.pnc.spi.BuildResult) ObjectWrapper(org.jboss.pnc.common.util.ObjectWrapper) BuildExecutionStatusChangedEvent(org.jboss.pnc.spi.events.BuildExecutionStatusChangedEvent) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 37 with BuildConfiguration

use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.

the class DatastoreMock method getLatestBuildConfigurationAudited.

@Override
public BuildConfigurationAudited getLatestBuildConfigurationAudited(Integer buildConfigId) {
    BuildConfiguration buildConfig = buildConfigurations.get(buildConfigId);
    int rev = buildConfigAuditedRevSequence.incrementAndGet();
    BuildConfigurationAudited buildConfigurationAudited = BuildConfigurationAudited.Builder.newBuilder().buildConfiguration(buildConfig).rev(rev).build();
    return buildConfigurationAudited;
}
Also used : BuildConfiguration(org.jboss.pnc.model.BuildConfiguration) BuildConfigurationAudited(org.jboss.pnc.model.BuildConfigurationAudited)

Example 38 with BuildConfiguration

use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.

the class TestProjectConfigurationBuilder method buildConfigurationWithDependencies.

public BuildConfiguration buildConfigurationWithDependencies(BuildConfigurationSet buildConfigurationSet) {
    BuildConfiguration buildConfiguration1 = build(1, "with-dependencies-1", buildConfigurationSet);
    BuildConfiguration buildConfiguration2 = build(2, "with-dependencies-2", buildConfigurationSet);
    BuildConfiguration buildConfiguration3 = build(3, "with-dependencies-3", buildConfigurationSet);
    BuildConfiguration buildConfiguration4 = build(4, "with-dependencies-4", buildConfigurationSet);
    BuildConfiguration buildConfiguration5 = build(5, "with-dependencies-5", buildConfigurationSet);
    buildConfiguration1.addDependency(buildConfiguration2);
    buildConfiguration1.addDependency(buildConfiguration3);
    buildConfiguration2.addDependency(buildConfiguration3);
    buildConfiguration2.addDependency(buildConfiguration4);
    buildConfiguration3.addDependency(buildConfiguration5);
    buildConfiguration4.addDependency(buildConfiguration5);
    return buildConfiguration1;
}
Also used : BuildConfiguration(org.jboss.pnc.model.BuildConfiguration)

Example 39 with BuildConfiguration

use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.

the class TestProjectConfigurationBuilder method buildConfigurationWithDependenciesThatFail.

public BuildConfiguration buildConfigurationWithDependenciesThatFail(BuildConfigurationSet buildConfigurationSet) {
    BuildConfiguration buildConfiguration1 = build(1, "with-dependencies-1", buildConfigurationSet);
    BuildConfiguration buildConfiguration2 = buildFailingConfiguration(2, "with-dependencies-2", buildConfigurationSet);
    buildConfiguration1.addDependency(buildConfiguration2);
    return buildConfiguration1;
}
Also used : BuildConfiguration(org.jboss.pnc.model.BuildConfiguration)

Example 40 with BuildConfiguration

use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.

the class TestProjectConfigurationBuilder method build.

public BuildConfiguration build(int id, String name, BuildConfigurationSet buildConfigurationSet) {
    Project project = new Project();
    project.setId(id);
    project.setName(name);
    RepositoryConfiguration repositoryConfiguration = RepositoryConfiguration.Builder.newBuilder().id(id).internalUrl("github.com/" + name).build();
    BuildConfiguration buildConfiguration = new BuildConfiguration();
    buildConfiguration.setId(id);
    buildConfiguration.setBuildScript(PASS);
    buildConfiguration.setName(id + "");
    buildConfiguration.setRepositoryConfiguration(repositoryConfiguration);
    buildConfiguration.setBuildType(BuildType.MVN);
    buildConfiguration.setBuildEnvironment(javaBuildEnvironment);
    buildConfiguration.setProject(project);
    buildConfiguration.setProject(project);
    buildConfiguration.setArchived(false);
    project.addBuildConfiguration(buildConfiguration);
    if (buildConfigurationSet != null) {
        buildConfigurationSet.addBuildConfiguration(buildConfiguration);
    }
    datastore.save(buildConfiguration);
    return buildConfiguration;
}
Also used : BuildConfiguration(org.jboss.pnc.model.BuildConfiguration) Project(org.jboss.pnc.model.Project) RepositoryConfiguration(org.jboss.pnc.model.RepositoryConfiguration)

Aggregations

BuildConfiguration (org.jboss.pnc.model.BuildConfiguration)65 Test (org.junit.Test)23 BuildConfigurationAudited (org.jboss.pnc.model.BuildConfigurationAudited)11 HashSet (java.util.HashSet)10 BuildRecord (org.jboss.pnc.model.BuildRecord)9 Project (org.jboss.pnc.model.Project)9 BuildOptions (org.jboss.pnc.spi.BuildOptions)9 BuildResult (org.jboss.pnc.spi.BuildResult)9 Logger (org.slf4j.Logger)9 LoggerFactory (org.slf4j.LoggerFactory)9 List (java.util.List)8 Set (java.util.Set)8 Inject (javax.inject.Inject)8 ObjectWrapper (org.jboss.pnc.common.util.ObjectWrapper)8 BuildConfigurationSet (org.jboss.pnc.model.BuildConfigurationSet)8 BuildExecutionStatusChangedEvent (org.jboss.pnc.spi.events.BuildExecutionStatusChangedEvent)8 IdRev (org.jboss.pnc.model.IdRev)7 BuildSetTask (org.jboss.pnc.spi.coordinator.BuildSetTask)7 BuildTask (org.jboss.pnc.spi.coordinator.BuildTask)7 Collectors (java.util.stream.Collectors)5