]> https://gitweb.dealii.org/ - dealii.git/commitdiff
update script to new api/v1 interface
authorMatthias Maier <tamiko@43-1.org>
Fri, 8 May 2020 02:51:45 +0000 (21:51 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 8 May 2020 02:55:10 +0000 (21:55 -0500)
contrib/utilities/query_testsuite

index be0e53902ec7176d0ab2c7b797ff0716417bd879..b69414c2816db174026b95e13c48a16b26b9041e 100755 (executable)
 ## ---------------------------------------------------------------------
 set -eu
 
-BASE_URL="https://cdash.43-1.org/"
+BASE_URL="https://cdash.43-1.org"
 
 # Quick and dirty script to query CDash on the command line and create a
 # formatted table
 
 links=false
-regex="commit"
+regex=".*"
 
 print_help() {
   echo "Usage: query_testsuite [-c|--commit <commit>] [-l|--links] [-h|--help]"
@@ -52,31 +52,29 @@ until [[ "$*" == "" ]]; do
 done
 
 query_testsuite() {
-  (echo "| Host | Configuration | Commit | Build errors | Build warnings | Failing tests | Passing tests | |";
-  echo -n "| - | - | - | :-: | :-: | :-: | :-:";
-  curl -s "${BASE_URL}/index.php?project=deal.II" |
-  grep -P -B 10 -A 43 "${regex}" |
-  grep -P "(only(failed|passed)|BuildError|commit|platform|site)" |
-  grep -v "onlydelta" |
-  sed -e "s#<a href=\"\\(view.*\\)\">\\([0-9]*\\)</a>#[\\2](${BASE_URL}\\1)#" \
-      -e "s#<a href=\".*\\(https://github.com/.*\\)\">\\(.*\\)&nbsp;</a>#[\\2](\\1)#" \
-      -e "s#.*\\(buildSummary.php?buildid=[0-9]*\\)\"[^>]*>\\([^<]*\\).*#[\\2](${BASE_URL}\\1)#" \
-      -e 's#</a>##g' \
-      -e 's#.*>##g' |
-  awk '{printf (NR%7==1) ? " |\n| " $0 : " | " $0}' |
-  sed -e "s#\\(.*buildid=\\([0-9]*\\).*\\)#\\2 \\1#" |
-  sort -n -k 1 |
-  sed -e "s#[0-9 ]*\\(.*\\)#\\1#" |
-  if $links; then
-      cat
-  else
-      sed -e 's#\[\([^]]*\)\]([^)]*)#\1#g'
-  fi) |
-  sed -e 's#\[\(0*\)\]([^)]*)#\1#g' \
-      -e 's#\[\([^]]*\)\]([^)]*onlypassed[^)]*)#\1#g' \
-      -e 's#\[\([0-9]*\)\]#[<b>\1</b>]#g' \
-      -e 's#[ ]\+# #g' |
-  column -t --separator "|" --output-separator " | "
+
+  echo "| Host | Configuration | Commit | Build errors | Build warnings | Failing tests | Passing tests |"
+  echo "| - | - | - | :-: | :-: | :-: | :-: |"
+
+  curl -s "${BASE_URL}/api/v1/index.php?project=deal.II" |
+    jq -r ".buildgroups | .[] | .builds | .[] | .id , .site , .buildname, .update.files, .compilation.error, .compilation.warning, .test.fail, .test.pass" |
+    paste -d ' ' - - - - - - - - |
+    sort -nr |
+    if $links; then
+      awk "{ print \$2,
+        \"[\" \$3 \"](${BASE_URL}/buildSummary.php?buildid=\" \$1 \")\", \
+        \"[\" \$4 \"](${BASE_URL}/viewUpdate.php?buildid=\" \$1 \")\", \
+        \"[\" \$5 \"](${BASE_URL}/viewBuildError.php?buildid=\" \$1 \")\", \
+        \"[\" \$6 \"](${BASE_URL}/viewBuildError.php?type=1&buildid=\" \$1 \")\", \
+        \"[\" \$7 \"](${BASE_URL}/viewTest.php?onlyfailed&buildid=\" \$1 \")\", \
+        \"[\" \$8 \"](${BASE_URL}/viewTest.php?onlypassed&buildid=\" \$1 \")\"
+      }"
+    else
+      awk '{$1=""; print $0}'
+    fi |
+    sed -e 's#^ ##' -e 's# # | #g' -e 's#^#| #' -e 's#$# |#' |
+    grep -P "${regex}" |
+    cat
 }
 
 query_testsuite

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.