use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class ExpliciteDependenciesTest method shouldBuildAOnModifiedB.
@Test
public void shouldBuildAOnModifiedB() throws TimeoutException, InterruptedException {
// when
insertNewBuildRecords(b);
BuildOptions buildOptions = new BuildOptions();
buildOptions.setRebuildMode(RebuildMode.EXPLICIT_DEPENDENCY_CHECK);
build(a, buildOptions);
// then
expectBuilt(a);
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class ExpliciteDependenciesTest method shouldNotBuildAOnModifiedC.
@Test
public void shouldNotBuildAOnModifiedC() throws TimeoutException, InterruptedException {
// when
insertNewBuildRecords(c);
BuildOptions buildOptions = new BuildOptions();
buildOptions.setRebuildMode(RebuildMode.EXPLICIT_DEPENDENCY_CHECK);
build(a, buildOptions);
// then
expectBuilt();
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class SkippingBuiltConfigsTest method shouldTriggerTheSameBuildConfigurationWithNewRevision.
@Test
public void shouldTriggerTheSameBuildConfigurationWithNewRevision() throws Exception {
coordinator.start();
buildRecordRepository.clear();
// given
BuildConfiguration testConfiguration = config("shouldRejectBCWithNewRevision");
BuildOptions buildOptions = new BuildOptions();
buildOptions.setBuildDependencies(false);
// when
coordinator.build(testConfiguration, user, buildOptions);
BuildConfiguration updatedConfiguration = updateConfiguration(testConfiguration);
BuildSetTask buildSetTask;
boolean rejected = false;
try {
buildSetTask = coordinator.build(updatedConfiguration, user, buildOptions);
} catch (BuildConflictException e) {
rejected = true;
}
// then
Assert.assertFalse("The task was rejected.", rejected);
waitForEmptyBuildQueue();
assertThat(getNonRejectedBuildRecords().size()).isEqualTo(2);
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class SkippingBuiltConfigsTest method shouldRerunTheSameBuildConfigurationSetIfRebuildAllIsSpecified.
@Test
public void shouldRerunTheSameBuildConfigurationSetIfRebuildAllIsSpecified() throws Exception {
// when
BuildOptions buildOptions = new BuildOptions();
buildOptions.setRebuildMode(RebuildMode.FORCE);
// first build
coordinator.build(configSet, user, buildOptions);
waitForEmptyBuildQueue();
// forced rebuild build
coordinator.build(configSet, user, buildOptions);
waitForEmptyBuildQueue();
// then
List<BuildRecord> buildRecords = getNonRejectedBuildRecords();
logRecords(buildRecords);
assertThat(buildRecords.size()).isEqualTo(2 * configSet.getBuildConfigurations().size());
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class SkippingBuiltConfigsTest method shouldNotBuildTheSameBuildConfigurationTwice.
@Test
public void shouldNotBuildTheSameBuildConfigurationTwice() throws Exception {
coordinator.start();
buildRecordRepository.clear();
// given
BuildConfiguration testConfiguration = config("shouldNotBuildTheSameBuildConfigurationTwice");
BuildOptions buildOptions = new BuildOptions();
buildOptions.setBuildDependencies(false);
// when
coordinator.build(testConfiguration, user, buildOptions);
waitForEmptyBuildQueue();
coordinator.build(testConfiguration, user, buildOptions);
waitForEmptyBuildQueue();
// then
// there should be one non build
assertThat(getNonRejectedBuildRecords().size()).isEqualTo(1);
// there should be stored one NO_REBUILD_REQUIRED
List<BuildRecord> collectNoRebuildRequired = buildRecordRepository.queryAll().stream().filter(r -> r.getStatus() == BuildStatus.NO_REBUILD_REQUIRED).collect(Collectors.toList());
assertThat(collectNoRebuildRequired.size()).isEqualTo(1);
assertThat(collectNoRebuildRequired.iterator().next().getNoRebuildCause()).isNotNull();
}
Aggregations