## ---------------------------------------------------------------------
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]"
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/.*\\)\">\\(.*\\) </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