This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 85ee006  Refactoring for critical/non critical suites
85ee006 is described below

commit 85ee006a3f1239456c57c362d137a397fe72298b
Author: Dmitriy Pavlov <dpav...@apache.org>
AuthorDate: Wed May 15 14:03:05 2019 +0300

    Refactoring for critical/non critical suites
---
 conf/branches.json                                 | 12 +++----
 .../ignited/fatbuild/FatBuildCompacted.java        | 37 +++++++++++-----------
 .../ignited/fatbuild/ProblemCompacted.java         | 12 +++++++
 3 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/conf/branches.json b/conf/branches.json
index 46c1933..5be6ae2 100644
--- a/conf/branches.json
+++ b/conf/branches.json
@@ -117,13 +117,13 @@
           /** List of build parameters should be specified for triggering 
build. Each parameter should have name and may have randomly selected or fixed 
value. */
           "triggerParameters": [
             {
-              name: "reverse.dep.*.env.JAVA_HOME",
-              randomValue: true,
+              "name": "reverse.dep.*.env.JAVA_HOME",
+              "randomValue": true,
               "selection": [
-                {value:"%env.JDK_ORA_18%", label:"JDK8"},
-                {value:"%env.JDK_ORA_9%", label:"JDK9"},
-                {value:"%env.JDK_ORA_10%", label:"JDK10"},
-                {value:"%env.JDK_OPEN_11%", label:"JDK11"}
+                {"value":"%env.JDK_ORA_18%", "label":"JDK8"},
+                {"value":"%env.JDK_ORA_9%", "label":"JDK9"},
+                {"value":"%env.JDK_ORA_10%", "label":"JDK10"},
+                {"value":"%env.JDK_OPEN_11%", "label":"JDK11"}
               ]
             }
           ]
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 2edfc4d..59feae2 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
@@ -621,8 +621,14 @@ public class FatBuildCompacted extends BuildRefCompacted 
implements IVersionedEn
             .toString();
     }
 
-    public Invocation toInvocation(IStringCompactor compactor,
-        BiPredicate<Integer, Integer> paramsFilter) {
+    /**
+     * Transforms suite to compact invocation.
+     *
+     * @param compactor Compactor.
+     * @param paramsFilter Params filter (key compactor's code, value 
compactor's code) for checking parameters to be
+     * saved in Invocation.
+     */
+    public Invocation toInvocation(IStringCompactor compactor, 
BiPredicate<Integer, Integer> paramsFilter) {
         boolean success = isSuccess(compactor);
 
         final int failCode ;
@@ -630,16 +636,9 @@ public class FatBuildCompacted extends BuildRefCompacted 
implements IVersionedEn
         if (success)
             failCode = InvocationData.OK;
         else {
-            if (problems()
-                .stream().anyMatch(occurrence ->
-                    occurrence.isExecutionTimeout(compactor)
-                        || occurrence.isJvmCrash(compactor)
-                        || occurrence.isBuildFailureOnMetric(compactor)
-                        || occurrence.isCompilationError(compactor)))
-                failCode = InvocationData.CRITICAL_FAILURE;
-            else
-                failCode = InvocationData.FAILURE;
-
+            failCode = problems().stream().anyMatch(occurrence -> 
occurrence.isCriticalProblem(compactor))
+                ? InvocationData.CRITICAL_FAILURE
+                : InvocationData.FAILURE;
         }
 
         Invocation invocation = new Invocation(getId())
@@ -649,14 +648,14 @@ public class FatBuildCompacted extends BuildRefCompacted 
implements IVersionedEn
 
         java.util.Map<Integer, Integer> importantParms = new TreeMap<>();
 
-        ParametersCompacted parameters = this.parameters();
-        if (parameters == null)
-            return invocation;
+        ParametersCompacted parameters = parameters();
 
-        parameters.forEach((k, v) -> {
-            if (paramsFilter.test(k, v))
-                importantParms.put(k, v);
-        });
+        if (parameters != null) {
+            parameters.forEach((k, v) -> {
+                if (paramsFilter.test(k, v))
+                    importantParms.put(k, v);
+            });
+        }
 
         return invocation;
     }
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
index c1942e0..ee0966f 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/ProblemCompacted.java
@@ -166,6 +166,7 @@ public class ProblemCompacted {
         return type;
     }
 
+    /** {@inheritDoc} */
     @Override public String toString() {
         return MoreObjects.toStringHelper(this)
             .add("id", id)
@@ -174,4 +175,15 @@ public class ProblemCompacted {
             .add("actualBuildId", actualBuildId)
             .toString() + "\n";
     }
+
+    /**
+     * @param compactor Compactor.
+     * @return if this problem is critical.
+     */
+    public boolean isCriticalProblem(IStringCompactor compactor) {
+        return isExecutionTimeout(compactor)
+            || isJvmCrash(compactor)
+            || isBuildFailureOnMetric(compactor)
+            || isCompilationError(compactor);
+    }
 }

Reply via email to