ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpav...@apache.org
Subject [ignite-teamcity-bot] 02/02: IGNITE-10095: Support Build Parameters saving for Fat Build
Date Mon, 06 May 2019 17:29:51 GMT
This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch ignite-10095
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 56c7d1b8d39331413114070acd61754f7ff8aed5
Author: Dmitriy Pavlov <dpavlov@apache.org>
AuthorDate: Mon May 6 20:29:25 2019 +0300

    IGNITE-10095: Support Build Parameters saving for Fat Build
---
 .../main/java/org/apache/ignite/ci/ITeamcity.java  | 30 +++----
 .../apache/ignite/ci/IgniteTeamcityConnection.java |  2 +-
 .../org/apache/ignite/ci/tcmodel/Properties.java   | 18 ++---
 .../ignite/ci/tcmodel/conf/bt/Parameters.java      | 21 +++--
 .../apache/ignite/ci/tcmodel/conf/bt/Property.java | 32 +++++---
 .../org/apache/ignite/ci/tcmodel/result/Build.java | 21 ++++-
 .../ci/teamcity/ignited/TeamcityIgnitedImpl.java   |  4 +-
 .../ignited/buildtype/ParametersCompacted.java     |  2 +-
 .../ignited/fatbuild/FatBuildCompacted.java        | 28 +++++--
 .../ignited/fatbuild/PropertiesCompacted.java      | 92 ++++++++++++++++++++++
 .../ignited/fatbuild/StatisticsCompacted.java      | 10 ++-
 .../ignited/IgnitedTcInMemoryIntegrationTest.java  | 10 +++
 12 files changed, 219 insertions(+), 51 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/ITeamcity.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/ITeamcity.java
index c9be5dc..c145e1f 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/ITeamcity.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/ITeamcity.java
@@ -17,34 +17,36 @@
 
 package org.apache.ignite.ci;
 
+import java.io.File;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
 import org.apache.ignite.ci.analysis.LogCheckResult;
 import org.apache.ignite.ci.analysis.SingleBuildRunCtx;
-import org.apache.ignite.ci.tcmodel.agent.Agent;
-import org.apache.ignite.ci.tcmodel.conf.BuildType;
-import org.apache.ignite.ci.tcmodel.hist.BuildRef;
-import org.apache.ignite.ci.tcmodel.result.Build;
 import org.apache.ignite.ci.tcmodel.user.User;
 import org.apache.ignite.ci.teamcity.pure.ITeamcityConn;
 import org.apache.ignite.ci.util.Base64Util;
-import org.apache.ignite.ci.util.FutureUtil;
-import org.jetbrains.annotations.NotNull;
-
-import javax.annotation.Nullable;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
 
 /**
  * API for calling methods from REST service:
  * https://confluence.jetbrains.com/display/TCD10/REST+API
  */
 public interface ITeamcity extends ITeamcityConn {
+    /** Default. */
     public String DEFAULT = "<default>";
+
+    /** Branch synonym: Refs heads master. */
     public String REFS_HEADS_MASTER = "refs/heads/master";
 
+    /** Branch synonym: Master. */
+    public String MASTER = "master";
+
+    /** Some fake property to avoid merging build in queue: Tcbot trigger time. */
+    public String TCBOT_TRIGGER_TIME = "tcbot.triggerTime";
+
+    /** Default list of properties to be skipped in saving in FAT builds. */
+    public String[] AVOID_SAVE_PROPERTIES = new String[] {TCBOT_TRIGGER_TIME, "build.query.loginTs"};
+
     CompletableFuture<File> unzipFirstFile(CompletableFuture<File> fut);
 
     CompletableFuture<File> downloadBuildLogZip(int id);
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
index 766e30d..d42029d 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
@@ -233,7 +233,7 @@ public class IgniteTeamcityConnection implements ITeamcity {
         if (buildParms != null)
             props.putAll(buildParms);
 
-        props.put("tcbot.triggerTime", System.currentTimeMillis()); // some fake property
to avoid merging build in queue
+        props.put(TCBOT_TRIGGER_TIME, System.currentTimeMillis()); //
 
         StringBuilder sb = new StringBuilder();
         sb.append("<build branchName=\"").append(xmlEscapeText(branchName)).append("\">\n");
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/Properties.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/Properties.java
index f03a7ed..192ec42 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/Properties.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/Properties.java
@@ -80,9 +80,9 @@ public class Properties {
      *
      */
     public List<Property> getProperty() {
-        if (property == null) {
-            property = new ArrayList<Property>();
-        }
+        if (property == null)
+            property = new ArrayList<>();
+
         return this.property;
     }
 
@@ -101,13 +101,13 @@ public class Properties {
     /**
      * Sets the value of the count property.
      *
-     * @param value
+     * @param val
      *     allowed object is
      *     {@link Integer }
      *
      */
-    public void setCount(Integer value) {
-        this.count = value;
+    public void setCount(Integer val) {
+        this.count = val;
     }
 
     /**
@@ -125,12 +125,12 @@ public class Properties {
     /**
      * Sets the value of the href property.
      *
-     * @param value
+     * @param val
      *     allowed object is
      *     {@link String }
      *
      */
-    public void setHref(String value) {
-        this.href = value;
+    public void setHref(String val) {
+        this.href = val;
     }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Parameters.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Parameters.java
index de93c4b..9f92e33 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Parameters.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Parameters.java
@@ -19,8 +19,6 @@ package org.apache.ignite.ci.tcmodel.conf.bt;
 
 import com.google.common.base.MoreObjects;
 import java.util.ArrayList;
-import org.jetbrains.annotations.Nullable;
-
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
@@ -28,6 +26,7 @@ import java.util.Optional;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Collection of parameters in build
@@ -40,21 +39,24 @@ public class Parameters {
     public Parameters() {
     }
 
-    public Parameters(List<Property> properties) {
-        this.properties = properties == null ? null : new ArrayList<>(properties);
+    public Parameters(List<Property> props) {
+        this.properties = props == null ? null : new ArrayList<>(props);
     }
 
+    /**
+     * @param key Key of parameter.
+     */
     @Nullable public String getParameter(String key) {
         if (properties == null)
             return null;
 
         final Optional<Property> any = properties.stream().filter(property ->
             Objects.equals(property.name, key)).findAny();
-        return any.map(Property::getValue).orElse(null);
+        return any.map(Property::value).orElse(null);
     }
 
     public List<Property> properties() {
-        if (this.properties==null)
+        if (this.properties == null)
             return Collections.emptyList();
 
         return Collections.unmodifiableList(this.properties);
@@ -91,4 +93,11 @@ public class Parameters {
             .add("properties", properties)
             .toString();
     }
+
+    /**
+     * @return {@code true} if this list contains no elements
+     */
+    public boolean isEmpty() {
+        return properties == null || properties.isEmpty();
+    }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Property.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Property.java
index af4b2c7..3f87d0a 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Property.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/conf/bt/Property.java
@@ -29,30 +29,40 @@ import org.jetbrains.annotations.Nullable;
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 public class Property {
+    /** Parameter Name/Key. */
     @XmlAttribute String name;
+
+    /** Parameter Value. */
     @XmlAttribute String value;
+
+    /** Flag indicating that value is inherited from a template. */
     @XmlAttribute Boolean inherited;
 
     public Property() {
     }
 
-    public Property(String name, String value) {
+    public Property(String name, String val) {
         this.name = name;
-        this.value = value;
+        this.value = val;
         this.inherited = null;
     }
 
-    public Property(String name, String value, Boolean inherited) {
+    public Property(String name, String val, Boolean inherited) {
         this.name = name;
-        this.value = value;
+        this.value = val;
         this.inherited = inherited;
     }
 
-    @Nullable
-    public String getValue() {
+    /**
+     * @return {@link #value}
+     */
+    @Nullable public String value() {
         return value;
     }
 
+    /**
+     * @return {@link #name}
+     */
     public String name() {
         return name;
     }
@@ -65,16 +75,16 @@ public class Property {
         if (!(o instanceof Property))
             return false;
 
-        Property property = (Property)o;
+        Property prop = (Property)o;
 
-        return Objects.equals(name, property.name) &&
-            Objects.equals(getValue(), property.getValue()) &&
-            Objects.equals(inherited, property.inherited);
+        return Objects.equals(name, prop.name) &&
+            Objects.equals(value(), prop.value()) &&
+            Objects.equals(inherited, prop.inherited);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return Objects.hash(name, getValue(), inherited);
+        return Objects.hash(name, value(), inherited);
     }
 
     /** {@inheritDoc} */
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/result/Build.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/result/Build.java
index 9af0c1b..aa4235a 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/result/Build.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/result/Build.java
@@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 import org.apache.ignite.ci.tcmodel.changes.ChangesListRef;
 import org.apache.ignite.ci.tcmodel.conf.BuildType;
+import org.apache.ignite.ci.tcmodel.conf.bt.Parameters;
 import org.apache.ignite.ci.tcmodel.hist.BuildRef;
 import org.apache.ignite.ci.tcmodel.vcs.Revision;
 import org.apache.ignite.ci.tcmodel.vcs.Revisions;
@@ -65,7 +66,7 @@ public class Build extends BuildRef {
 
     @XmlElement(name = "statistics") public StatisticsRef statisticsRef;
 
-    /** Changes included into build.*/
+    /** Changes included into build. */
     @XmlElement(name = "changes") public ChangesListRef changesRef;
 
     /** Information about build triggering. */
@@ -73,6 +74,9 @@ public class Build extends BuildRef {
 
     @XmlElement(name = "revisions") private Revisions revisions;
 
+    /** Build parameters. */
+    @Nullable @XmlElement(name = "properties") private Parameters properties;
+
     @NotNull public static Build createFakeStub() {
         return new Build();
     }
@@ -187,4 +191,19 @@ public class Build extends BuildRef {
         this.revisions = new Revisions();
         this.revisions.revisions(revisions);
     }
+
+    /**
+     * @param s Parameter key.
+     */
+    @Nullable public String parameter(String s) {
+        return properties == null ? null : properties.getParameter(s);
+    }
+
+    @Nullable public Parameters parameters() {
+        return properties;
+    }
+
+    public void parameters(Parameters parameters) {
+        this.properties = parameters;
+    }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
index 9a4c0aa..3577d14 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
@@ -78,7 +78,6 @@ import static org.apache.ignite.ci.tcmodel.hist.BuildRef.STATUS_UNKNOWN;
  *
  */
 public class TeamcityIgnitedImpl implements ITeamcityIgnited {
-
     /** Default project id. */
     public static final String DEFAULT_PROJECT_ID = "IgniteTests24Java8";
 
@@ -88,9 +87,10 @@ public class TeamcityIgnitedImpl implements ITeamcityIgnited {
     /** Max build id diff to enforce reload during incremental refresh. */
     public static final int MAX_ID_DIFF_TO_ENFORCE_CONTINUE_SCAN = 3000;
 
+    /** Default synonyms. */
     private static final List<String> DEFAULT_SYNONYMS
             = Collections.unmodifiableList(
-                    Lists.newArrayList(ITeamcity.DEFAULT, ITeamcity.REFS_HEADS_MASTER, "master"));
+                    Lists.newArrayList(ITeamcity.DEFAULT, ITeamcity.REFS_HEADS_MASTER, ITeamcity.MASTER));
 
     /** Server (service) code. */
     private String srvCode;
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildtype/ParametersCompacted.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildtype/ParametersCompacted.java
index ebac6b9..dd7180f 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildtype/ParametersCompacted.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildtype/ParametersCompacted.java
@@ -50,7 +50,7 @@ public class ParametersCompacted {
             if (Strings.isNullOrEmpty(name))
                 continue;
 
-            String strVal = next.getValue();
+            String strVal = next.value();
             if (Strings.isNullOrEmpty(strVal))
                 continue;
 
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
index 8ec87d5..b7ed85f 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
@@ -30,6 +30,8 @@ import java.util.stream.Stream;
 import org.apache.ignite.ci.analysis.IVersionedEntity;
 import org.apache.ignite.ci.db.Persisted;
 import org.apache.ignite.ci.tcmodel.conf.BuildType;
+import org.apache.ignite.ci.tcmodel.conf.bt.Parameters;
+import org.apache.ignite.ci.tcmodel.conf.bt.Property;
 import org.apache.ignite.ci.tcmodel.hist.BuildRef;
 import org.apache.ignite.ci.tcmodel.result.Build;
 import org.apache.ignite.ci.tcmodel.result.TestOccurrencesRef;
@@ -116,6 +118,8 @@ public class FatBuildCompacted extends BuildRefCompacted implements IVersionedEn
 
     @Nullable private RevisionCompacted revisions[];
 
+    @Nullable private PropertiesCompacted parameters;
+
     /** {@inheritDoc} */
     @Override public int version() {
         return _ver;
@@ -200,13 +204,18 @@ public class FatBuildCompacted extends BuildRefCompacted implements
IVersionedEn
         }
 
         Revisions revisions = build.getRevisions();
-        if(revisions!=null) {
+        if (revisions != null) {
             this.revisions = revisions.revisions()
                 .stream()
                 .filter(b -> b.version() != null)
                 .map(revision -> new RevisionCompacted(compactor, revision))
                 .toArray(RevisionCompacted[]::new);
         }
+
+        Parameters parameters = build.parameters();
+
+        if (parameters != null && !parameters.isEmpty())
+            this.parameters = new PropertiesCompacted(compactor, parameters);
     }
 
     public FatBuildCompacted setFakeStub(boolean val) {
@@ -240,7 +249,7 @@ public class FatBuildCompacted extends BuildRefCompacted implements IVersionedEn
 
     /**
      * @param compactor Compactor.
-     * @param res Response.
+     * @param res Resulting build.
      */
     private void fillBuildFields(IStringCompactor compactor, Build res) {
         if (startDate > 0)
@@ -322,6 +331,14 @@ public class FatBuildCompacted extends BuildRefCompacted implements IVersionedEn
                         .vcsRootId(vcsRootId));
             }).collect(Collectors.toList()));
         }
+
+        if (parameters != null) {
+            List<Property> props = new ArrayList<>();
+
+            parameters.forEach(compactor, (k, v) -> props.add(new Property(k, v)));
+
+            res.parameters(new Parameters(props));
+        }
     }
 
     /**
@@ -417,12 +434,13 @@ public class FatBuildCompacted extends BuildRefCompacted implements
IVersionedEn
             Objects.equals(statistics, that.statistics) &&
             Arrays.equals(changesIds, that.changesIds) &&
             Objects.equals(triggered, that.triggered) &&
-            Arrays.equals(revisions, that.revisions);
+            Arrays.equals(revisions, that.revisions) &&
+            Objects.equals(parameters, that.parameters);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        int res = Objects.hash(super.hashCode(), _ver, startDate, finishDate, queuedDate,
projectId, name, tests, flags, problems, statistics, triggered);
+        int res = Objects.hash(super.hashCode(), _ver, startDate, finishDate, queuedDate,
projectId, name, tests, flags, problems, statistics, triggered, parameters);
         res = 31 * res + Arrays.hashCode(snapshotDeps);
         res = 31 * res + Arrays.hashCode(changesIds);
         res = 31 * res + Arrays.hashCode(revisions);
@@ -441,7 +459,7 @@ public class FatBuildCompacted extends BuildRefCompacted implements IVersionedEn
     /**
      *
      */
-    public boolean isFakeStub() {
+    @Override public boolean isFakeStub() {
         if (getId() == null)
             return true;
 
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/PropertiesCompacted.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/PropertiesCompacted.java
new file mode 100644
index 0000000..070e3dd
--- /dev/null
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/PropertiesCompacted.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.ci.teamcity.ignited.fatbuild;
+
+import com.google.common.base.Strings;
+import java.util.List;
+import java.util.function.BiConsumer;
+import org.apache.ignite.ci.db.Persisted;
+import org.apache.ignite.ci.tcmodel.conf.bt.Parameters;
+import org.apache.ignite.ci.tcmodel.conf.bt.Property;
+import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
+import org.apache.ignite.internal.util.GridIntList;
+
+/**
+ * Properties (Build parameters) compacted value for storing in TC Bot DB
+ */
+@Persisted
+public class PropertiesCompacted {
+    /** Property Keys (Names), int value is coming from the compatcor. */
+    private GridIntList keys;
+
+    /** Property Values, int value is coming from the compatcor. */
+    private GridIntList values;
+
+    public PropertiesCompacted() {
+    }
+
+    public PropertiesCompacted(IStringCompactor compactor, Parameters parameters) {
+        List<Property> props = parameters.properties();
+        int size = props.size();
+        keys = new GridIntList(size);
+        values = new GridIntList(size);
+
+        for (Property next : props) {
+            String name = next.name();
+            if (Strings.isNullOrEmpty(name))
+                continue;
+
+            String valStr = next.value();
+
+            keys.add(compactor.getStringId(name));
+            values.add(compactor.getStringId(valStr));
+        }
+    }
+
+    private long findPropertyValue(int propCode) {
+        if (keys == null)
+            return -1L;
+
+        int size = keys.size();
+
+        for (int i = 0; i < size; i++) {
+            int nameid = keys.get(i);
+
+            if (nameid == propCode)
+                return i < values.size() ? values.get(i) : -1;
+        }
+
+        return -1L;
+    }
+
+    public void forEach(IStringCompactor compactor, BiConsumer<String, String> consumer)
{
+        int size = keys.size();
+
+        for (int i = 0; i < size; i++) {
+            int nameid = keys.get(i);
+
+            if (i >= values.size())
+                break;
+
+            int valId = values.get(i);
+
+            consumer.accept(compactor.getStringFromId(nameid), compactor.getStringFromId(valId));
+        }
+
+    }
+}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/StatisticsCompacted.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/StatisticsCompacted.java
index 02254a0..1d66c5b 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/StatisticsCompacted.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/StatisticsCompacted.java
@@ -19,6 +19,7 @@ package org.apache.ignite.ci.teamcity.ignited.fatbuild;
 
 import com.google.common.base.Strings;
 import java.util.List;
+import org.apache.ignite.ci.db.Persisted;
 import org.apache.ignite.ci.tcmodel.conf.bt.Property;
 import org.apache.ignite.ci.tcmodel.result.stat.Statistics;
 import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
@@ -27,11 +28,18 @@ import org.apache.ignite.internal.util.GridLongList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Statistics values to be saved in compacted form.
+ */
+@Persisted
 public class StatisticsCompacted {
     /** Logger. */
     private static final Logger logger = LoggerFactory.getLogger(StatisticsCompacted.class);
 
+    /** Statistics Keys (Names), int value is coming from the compatcor. */
     private GridIntList keys;
+
+    /** Statistics Parsed Values as long. */
     private GridLongList values;
 
     public StatisticsCompacted() {
@@ -48,7 +56,7 @@ public class StatisticsCompacted {
             if (Strings.isNullOrEmpty(name))
                 continue;
 
-            final String valStr = next.getValue();
+            final String valStr = next.value();
             if (Strings.isNullOrEmpty(valStr))
                 continue;
 
diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/teamcity/ignited/IgnitedTcInMemoryIntegrationTest.java
b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/teamcity/ignited/IgnitedTcInMemoryIntegrationTest.java
index 04964fd..3a2faa9 100644
--- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/teamcity/ignited/IgnitedTcInMemoryIntegrationTest.java
+++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/teamcity/ignited/IgnitedTcInMemoryIntegrationTest.java
@@ -477,6 +477,9 @@ public class IgnitedTcInMemoryIntegrationTest {
         assertEquals(refBuild.getStartDate(), actBuild.getStartDate());
         assertEquals(refBuild.getFinishDate(), actBuild.getFinishDate());
 
+        assertParameter(refBuild, actBuild, "env.JAVA_HOME");
+        assertParameter(refBuild, actBuild, "reverse.dep.*.env.JAVA_HOME");
+
         final Triggered refTrig = refBuild.getTriggered();
         final Triggered actTrig = actBuild.getTriggered();
         assertNotNull(refTrig);
@@ -532,6 +535,13 @@ public class IgnitedTcInMemoryIntegrationTest {
         assertEquals(refRev0.vcsBranchName(), actRev0.vcsBranchName());
         assertEquals(refRev0.vcsRootInstance().id(), actRev0.vcsRootInstance().id());
         assertEquals(refRev0.vcsRootInstance().vcsRootId(), actRev0.vcsRootInstance().vcsRootId());
+
+
+    }
+
+    public void assertParameter(Build refBuild, Build actBuild, String parmKey) {
+        assertNotNull(refBuild.parameter(parmKey));
+        assertEquals(refBuild.parameter(parmKey), actBuild.parameter(parmKey));
     }
 
     private void saveTmpFile(Object obj, String name) throws IOException, JAXBException {


Mime
View raw message