Skip to content
Permalink
Browse files
IGNITE-10095: Support Build Parameters specifying: bugfixing
  • Loading branch information
dspavlov committed May 8, 2019
1 parent b02303f commit 6f332cd083320af5f550277966481d0d0d5fe40a
Showing 4 changed files with 29 additions and 6 deletions.
@@ -25,7 +25,9 @@
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.BiPredicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.ignite.ci.ITeamcity;
@@ -619,7 +621,8 @@ public int[] snapshotDependencies() {
.toString();
}

public Invocation toInvocation(IStringCompactor compactor) {
public Invocation toInvocation(IStringCompactor compactor,
BiPredicate<Integer, Integer> paramsFilter) {
boolean success = isSuccess(compactor);

final int failCode ;
@@ -639,10 +642,23 @@ public Invocation toInvocation(IStringCompactor compactor) {

}

return new Invocation(getId())
Invocation invocation = new Invocation(getId())
.withStatus(failCode)
.withStartDate(getStartDateTs())
.withChanges(changes());

java.util.Map<Integer, Integer> importantParms = new TreeMap<>();

ParametersCompacted parameters = this.parameters();
if (parameters == null)
return invocation;

parameters.forEach((k, v) -> {
if (paramsFilter.test(k, v))
importantParms.put(k, v);
});

return invocation;
}

public void setVersion(short ver) {
@@ -33,6 +33,7 @@
import org.apache.ignite.ci.tcmodel.result.tests.TestOccurrenceFull;
import org.apache.ignite.ci.tcmodel.result.tests.TestRef;
import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
import org.apache.ignite.ci.teamcity.ignited.buildtype.ParametersCompacted;
import org.apache.ignite.ci.teamcity.ignited.runhist.Invocation;
import org.apache.ignite.ci.teamcity.ignited.runhist.InvocationData;
import org.jetbrains.annotations.Nullable;
@@ -390,7 +391,11 @@ public Invocation toInvocation(IStringCompactor compactor,

java.util.Map<Integer, Integer> importantParms = new TreeMap<>();

build.parameters().forEach((k, v) -> {
ParametersCompacted parameters = build.parameters();
if (parameters == null)
return invocation;

parameters.forEach((k, v) -> {
if (paramsFilter.test(k, v))
importantParms.put(k, v);
});
@@ -29,6 +29,7 @@
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiPredicate;
import java.util.stream.Collectors;
import javax.annotation.concurrent.GuardedBy;
import javax.inject.Inject;
@@ -109,6 +110,7 @@ public void saveToHistoryLater(String srvCode, FatBuildCompacted build) {

Set<Integer> allTriggeringBuildParameters = getFilteringParameters(srvCode);

BiPredicate<Integer, Integer> parmFilter = (k, v) -> allTriggeringBuildParameters.contains(k);
boolean saveNow = false;

int branchNameNormalized = compactor.getStringId(normalizeBranch(build.branchName(compactor)));
@@ -118,13 +120,13 @@ public void saveToHistoryLater(String srvCode, FatBuildCompacted build) {
build.getAllTests().forEach(t -> {
RunHistKey histKey = new RunHistKey(srvId, t.testName(), branchNameNormalized);
List<Invocation> list = testInvMap.computeIfAbsent(histKey, k -> new ArrayList<>());
list.add(t.toInvocation(compactor, build, (k, v) -> allTriggeringBuildParameters.contains(k)));
list.add(t.toInvocation(compactor, build, parmFilter));

cntTests.incrementAndGet();
});

RunHistKey buildInvKey = new RunHistKey(srvId, build.buildTypeId(), branchNameNormalized);
Invocation buildInv = build.toInvocation(compactor);
Invocation buildInv = build.toInvocation(compactor, parmFilter);

int cnt = cntTests.get();

@@ -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 = "20190507";
public static final String VERSION = "20190508";

/** Java version, where Web App is running. */
public String javaVer;

0 comments on commit 6f332cd

Please sign in to comment.