You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/13 11:19:03 UTC

[camel] branch main updated: (chores) ci: make the results easier to understand

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

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new ec3a54c9667 (chores) ci: make the results easier to understand
ec3a54c9667 is described below

commit ec3a54c9667a13be1a0b92c31e866c2c2db133ca
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Oct 13 13:18:51 2022 +0200

    (chores) ci: make the results easier to understand
---
 .github/actions/quick-test/quick-test.sh |  6 +++++-
 .github/workflows/component-pr.yaml      | 15 ++++++++-------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/.github/actions/quick-test/quick-test.sh b/.github/actions/quick-test/quick-test.sh
index 67970f12c95..f00d0d8d254 100755
--- a/.github/actions/quick-test/quick-test.sh
+++ b/.github/actions/quick-test/quick-test.sh
@@ -27,6 +27,7 @@ MVN_OPTS=${MVN_OPTS:-$MVN_DEFAULT_OPTS}
 
 # Script variables
 failures=0
+successes=0
 maxNumberOfTestableComponents=20
 basedir=$(pwd)
 testDate=$(date '+%Y-%m-%d-%H%M%S')
@@ -67,6 +68,7 @@ function runTest() {
     ((failures++))
     notifyError "${component} test" "${total}" "${current}" "${failures}"
   else
+    ((successes++))
     notifySuccess "${component}" "${total}" "${current}" "${failures}"
   fi
 
@@ -111,7 +113,6 @@ function main() {
     coreTest
   fi
 
-
   echo "Searching for modified components"
   local components=$(git diff "${startCommit}..${endCommit}" --name-only --pretty=format:"" | grep -e '^components' | grep -v -e '^$' | cut -d / -f 1-2 | uniq | sort)
   local total=$(echo "${components}" | grep -v -e '^$' | wc -l)
@@ -120,11 +121,13 @@ function main() {
   if [[ ${total} -eq 0 ]]; then
     echo "0" > "${logDir}/tested"
     echo "0" > "${logDir}/failures"
+    echo "0" > "${logDir}/successes"
     exit 0
   else
     if [[ ${total} -gt ${maxNumberOfTestableComponents} ]]; then
       echo "0" > "${logDir}/tested"
       echo "0" > "${logDir}/failures"
+      echo "0" > "${logDir}/successes"
       exit 0
     fi
   fi
@@ -142,6 +145,7 @@ function main() {
 
   echo "${total}" > "${logDir}/tested"
   echo "${failures}" > "${logDir}/failures"
+  echo "${successes}" > "${logDir}/successes"
   exit "${failures}"
 }
 
diff --git a/.github/workflows/component-pr.yaml b/.github/workflows/component-pr.yaml
index 701c68a8dd2..f7af7263ec7 100644
--- a/.github/workflows/component-pr.yaml
+++ b/.github/workflows/component-pr.yaml
@@ -52,7 +52,7 @@ jobs:
               issue_number: context.issue.number,
               owner: context.repo.owner,
               repo: context.repo.repo,
-              body: `:star2: Thanks for your contribution to the Apache Camel project! :star2: 
+              body: `:star2: Thank you for your contribution to the Apache Camel project! :star2: 
             
             :warning: Please note that the changes on this PR may be **tested automatically**. 
             
@@ -97,7 +97,8 @@ jobs:
             let total = Number(fs.readFileSync('./total'));
             let tested = Number(fs.readFileSync('./tested'));
             let failures = Number(fs.readFileSync('./failures'));
-
+            let successes = Number(fs.readFileSync('./successes'));
+                                
             var message = ""
 
             if (tested === 0) {
@@ -109,11 +110,11 @@ jobs:
                 }
               }
             } else {
-              if (failures === 0) {
-                message = `:heavy_check_mark: Finished component verification: ${failures} component(s) test failed out of **${tested} component(s) tested**`
-              } else {
-                message = `:x: Finished component verification: **${failures} component(s) test failed** out of ${tested} component(s) tested`
-              }
+              message = `### Components tested: 
+                    | Total | Tested | Failed :x: | Passed :white_check_mark: | 
+                    | --- | --- | --- |  --- |
+                    | ${total} | ${tested} | ${failures} | ${successes} | 
+                    `
             }
 
             await github.rest.issues.createComment({