Skip to content
Permalink
Browse files
Tests fix & version updated
  • Loading branch information
dspavlov committed Aug 6, 2019
1 parent f551827 commit aa2ca9f5771d0f5b419a88db3040624d8bba1ac7
Showing 4 changed files with 13 additions and 5 deletions.
@@ -28,7 +28,7 @@
public static final String GITHUB_REF = "https://github.com/apache/ignite-teamcity-bot";

/** TC Bot Version. */
public static final String VERSION = "20190804";
public static final String VERSION = "20190805";

/** Java version, where Web App is running. */
public String javaVer;
@@ -27,6 +27,7 @@
import java.util.OptionalInt;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
import org.apache.ignite.tcservice.ITeamcity;
import org.apache.ignite.tcbot.engine.conf.BranchTracked;
import org.apache.ignite.tcbot.engine.conf.ChainAtServerTracked;
@@ -143,25 +144,26 @@ public void emulateHistory(String chainId,
IStringCompactor c,
Map<String, String> pds1Hist,
Map<String, String> buildWoChanges) {
OptionalInt longestHist = pds1Hist.values().stream().mapToInt(String::length).max();
OptionalInt longestHist = Stream.concat(pds1Hist.values().stream(),
buildWoChanges.values().stream()).mapToInt(String::length).max();
Preconditions.checkState(longestHist.isPresent());
int histLen = longestHist.getAsInt();

for (int i = 0; i < histLen; i++) {
FatBuildCompacted pds1Build
= createFatBuild(c, "PDS1", ITeamcity.DEFAULT, 1100 + i, 1000 * i, false)
= createFatBuild(c, "PDS1", ITeamcity.DEFAULT, 1100 + i, 100 * i, false)
.addTests(c, testsMapToXmlModel(pds1Hist, histLen, i), null)
.changes(new int[] {i});

apacheBuilds.put(pds1Build.id(), pds1Build);

FatBuildCompacted pds2Build
= createFatBuild(c, "PDS2_noChanges", ITeamcity.DEFAULT, 1200 + i, 1000 * i, false)
= createFatBuild(c, "PDS2_noChanges", ITeamcity.DEFAULT, 1200 + i, 100 * i, false)
.addTests(c, testsMapToXmlModel(buildWoChanges, histLen, i), null);

apacheBuilds.put(pds2Build.id(), pds2Build);

FatBuildCompacted chainBuild = createFatBuild(c, chainId, ITeamcity.DEFAULT, 1000 + i, 1000 * i, false)
FatBuildCompacted chainBuild = createFatBuild(c, chainId, ITeamcity.DEFAULT, 1000 + i, 100 * i, false)
.snapshotDependencies(new int[] {pds1Build.id(), pds2Build.id()});
apacheBuilds.put(chainBuild.id(), chainBuild);
}
@@ -436,6 +436,7 @@ public void testFatBuild() throws JAXBException, IOException {
@Override protected void configure() {
bind(Ignite.class).toInstance(ignite);
bind(IStringCompactor.class).to(IgniteStringCompactor.class).in(new SingletonScope());
bind(IDataSourcesConfigSupplier.class).toInstance(Mockito.mock(IDataSourcesConfigSupplier.class));
bind(ILogProductSpecific.class).toInstance(Mockito.mock(ILogProductSpecific.class));
}
});
@@ -24,6 +24,7 @@
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.apache.ignite.tcbot.common.TcBotConst;
import org.apache.ignite.tcignited.history.ChangesState;
@@ -188,7 +189,11 @@ private static Integer checkTemplateAtPos(int[] template, int centralEvtBuild, L

/** {@inheritDoc} */
@Override public String toString() {
Stream<CharSequence> stream = data.getLatestRuns().stream().filter(Objects::nonNull).map(Object::toString);
String join = String.join("", stream::iterator);

return MoreObjects.toStringHelper(this)
.add("runs", join)
.add("failRate", getFailPercentPrintable())
.add("data", data)
.toString();

0 comments on commit aa2ca9f

Please sign in to comment.