From e90d95117b545358cd889b5cd2acd1b673aa7e03 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 7 Aug 2014 14:55:15 +0000 Subject: Detect lack of network and report as such, rather than fail If the git remote update command fails, we assume it's because we are unable to connect to the trove. This gets reported as a networking issue, rather than as a failure. --- mason/mason-report.sh | 21 ++++++++++++++++++++- mason/mason.sh | 5 ++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/mason/mason-report.sh b/mason/mason-report.sh index d6cf0c19..40ecbf62 100755 --- a/mason/mason-report.sh +++ b/mason/mason-report.sh @@ -57,6 +57,12 @@ table tr.fail { table tr.fail:hover { background: #ffbbbb; } +table tr.nonet { + background: #ffdd99; +} +table tr.nonet:hover { + background: #ffeeaa; +} table tr.headings th { font-weight: bold; text-align: left; @@ -87,6 +93,12 @@ tr.fail td.result a { tr.fail td.result a:hover { color: #933; } +tr.nonet td.result a { + color: #641; +} +tr.nonet td.result a:hover { + color: #962; +} td.ref { font-family: monospace; } @@ -161,7 +173,11 @@ update_report() { fi # Build table row for insertion into report file - msg=''"${build_start_time}"''"${build_sha1}"''"${build_duration}s"''"${build_result}"'' + if [ "$build_result" = nonet ]; then + msg=''"${build_start_time}"'Failed to contact '"${build_trove_host}"''"${build_duration}s"''"${build_result}"'' + else + msg=''"${build_start_time}"''"${build_sha1}"''"${build_duration}s"''"${build_result}"'' + fi # Insert report line, newest at top sed -i 's//\n'"$(sed_escape "$msg")"'/' $REPORT_PATH @@ -178,6 +194,9 @@ case "${PIPESTATUS[0]}" in 33) RESULT=skip ;; +42) + RESULT=nonet + ;; *) RESULT=fail ;; diff --git a/mason/mason.sh b/mason/mason.sh index dfed71f7..1fdcf2de 100755 --- a/mason/mason.sh +++ b/mason/mason.sh @@ -22,7 +22,10 @@ else SHA1_PREV="$(git rev-parse HEAD)" fi -git remote update origin +if ! git remote update origin; then + echo ERROR: Unable to contact trove + exit 42 +fi git clean -fxd git reset --hard origin/"$DEFINITIONS_REF" -- cgit v1.2.1