ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ira...@apache.org
Subject [ignite-teamcity-bot] 04/04: Added web link to suite names in new tests list #170
Date Thu, 09 Jul 2020 20:19:05 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 82c3594269fa07cba9c6a572f8299af92d47df2f
Author: sergeyuttsel <uttsel@gmail.com>
AuthorDate: Thu Jul 9 23:17:13 2020 +0300

    Added web link to suite names in new tests list #170
    
    Signed-off-by: Ivan Rakov <ivan.glukos@gmail.com>
---
 .../ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java  |  4 ++--
 ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js     |  3 +++
 .../org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java |  2 +-
 .../java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java    |  2 +-
 .../apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java  | 12 +++++++++++-
 5 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 4523a57..ff4f5e8 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -928,13 +928,13 @@ public class TcBotTriggerAndSignOffService {
             newTests.append(jiraEscText(suite.name)).append("{color}");
 
             int totalNewTests = suite.tests.size();
-            newTests.append(" [tests ").append(totalNewTests);
+            newTests.append(" [[tests ").append(totalNewTests);
 
             int cnt = 0;
 
             newTestsCount += suite.tests().size();
 
-            newTests.append("]\\n");
+            newTests.append('|').append(suite.webToBuild).append("]]\\n");
 
             for (ShortTestUi test : suite.tests()) {
                 String testColor;
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
index 5a0b573..bc4313e 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
@@ -111,6 +111,9 @@ function showNewTestsData(chain, settings) {
 
     for (var i = 0; i < chain.length; i++) {
         var newTests = chain[i].tests;
+        newTestRows += "<tr><td colspan='2' width='10%'></td>";
+        newTestRows += "<td colspan='2' width='80%'><a href='" + chain[i].webToBuild
+ "'>" + chain[i].name + "</a>" + "</td></tr>";
+        newTestRows += "<td colspan='2' width='10%'></td>";
         for (var j = 0; j < newTests.length; j++) {
             newTestsFounded = true
             var newTest = newTests[j];
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
index 698a8b7..8f0d56b 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
@@ -403,7 +403,7 @@ public class PrChainsProcessor {
                 if (!missingTests.isEmpty()) {
                     return new ShortSuiteNewTestsUi()
                         .tests(missingTests)
-                        .initFrom(ctx);
+                        .initFrom(ctx, tcIgnited);
                 }
                 return null;
             })
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
index cf2147e..f31aafe 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
@@ -314,7 +314,7 @@ public class DsChainUi {
                 if (!missingTests.isEmpty()) {
                     return new ShortSuiteNewTestsUi()
                         .tests(missingTests)
-                        .initFrom(suite);
+                        .initFrom(suite, tcIgnited);
                 }
                 return null;
             })
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
index 8bfb2e5..7e37efb 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/ShortSuiteNewTestsUi.java
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.List;
 import javax.annotation.Nonnull;
 import org.apache.ignite.tcbot.engine.chain.MultBuildRunCtx;
+import org.apache.ignite.tcignited.ITeamcityIgnited;
 
 public class ShortSuiteNewTestsUi extends DsHistoryStatUi {
     /** Suite Name */
@@ -28,6 +29,9 @@ public class ShortSuiteNewTestsUi extends DsHistoryStatUi {
 
     public List<ShortTestUi> tests = new ArrayList<>();
 
+    /** Web Href. to suite particular run */
+    public String webToBuild = "";
+
     public Collection<? extends ShortTestUi> tests() {
         return tests;
     }
@@ -38,9 +42,15 @@ public class ShortSuiteNewTestsUi extends DsHistoryStatUi {
         return this;
     }
 
-    public ShortSuiteNewTestsUi initFrom(@Nonnull MultBuildRunCtx suite) {
+    public ShortSuiteNewTestsUi initFrom(@Nonnull MultBuildRunCtx suite,
+        ITeamcityIgnited tcIgnited) {
         name = suite.suiteName();
+        webToBuild = buildWebLinkToBuild(tcIgnited, suite);
 
         return this;
     }
+
+    private static String buildWebLinkToBuild(ITeamcityIgnited teamcity, MultBuildRunCtx
chain) {
+        return teamcity.host() + "viewLog.html?buildId=" + chain.getBuildId();
+    }
 }


Mime
View raw message