[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229284966
 
 

 ##########
 File path: ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/TcHelper.java
 ##########
 @@ -193,61 +216,87 @@ private String generateJiraComment(
 
                 Map<String, List<SuiteCurrentStatus>> fails = findFailures(server);
 
-                for (List<SuiteCurrentStatus> suites : fails.values()) {
-                    for (SuiteCurrentStatus suite : suites) {
-                        res.append("{color:#d04437}").append(suite.name).append("{color}");
-                        res.append(" [[tests ").append(suite.failedTests);
+                fails.entrySet().forEach(e -> res.addAll(e.getValue()));
+            }
+        }
+
+        return res;
+    }
+
+    /** */
+    private String generateJiraComment(List<SuiteCurrentStatus> suites, String webUrl) {
+        StringBuilder res = new StringBuilder();
 
-                        if (suite.result != null && !suite.result.isEmpty())
-                            res.append(' ').append(suite.result);
+        for (SuiteCurrentStatus suite : suites) {
+            res.append("{color:#d04437}").append(suite.name).append("{color}");
+            res.append(" [[tests ").append(suite.failedTests);
 
-                        res.append('|').append(suite.webToBuild).append("]]\\n");
+            if (suite.result != null && !suite.result.isEmpty())
+                res.append(' ').append(suite.result);
 
-                        for (TestFailure failure : suite.testFailures) {
-                            res.append("* ");
+            res.append('|').append(suite.webToBuild).append("]]\\n");
 
-                            if (failure.suiteName != null && failure.testName != null)
-                                res.append(failure.suiteName).append(": ").append(failure.testName);
-                            else
-                                res.append(failure.name);
+            for (TestFailure failure : suite.testFailures) {
+                res.append("* ");
 
-                            FailureSummary recent = failure.histBaseBranch.recent;
+                if (failure.suiteName != null && failure.testName != null)
+                    res.append(failure.suiteName).append(": ").append(failure.testName);
+                else
 
 Review comment:
   Remove empty line before closing brace.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services