Merge branch '19092-upload-crunchstat_summary-to-pypi'
[arvados-dev.git] / jenkins / run-diagnostics-suite.sh
index e1229ff2aada1ddcd77fe571a19d090bb8323c2f..c7aaa9fdd8f2d7b5314c1759708440457e56a12d 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 EXITCODE=0
 
 INSTANCE=$1
@@ -10,6 +14,22 @@ if [[ "$INSTANCE" == '' ]]; then
   exit 1
 fi
 
+if [[ "$REVISION" == '' ]]; then
+  # See if there's a configuration file with the revision?
+  CONFIG_PATH=/home/jenkins/configuration/$INSTANCE.arvadosapi.com-versions.conf
+  if [[ -f $CONFIG_PATH ]]; then
+    echo "Loading git revision from $CONFIG_PATH"
+    . $CONFIG_PATH
+    REVISION=$ARVADOS_GIT_REVISION
+  fi
+fi
+
+if [[ "$REVISION" != '' ]]; then
+  echo "Git revision is $REVISION"
+else
+  echo "No valid git revision found, proceeding with what is in place."
+fi
+
 # Sanity check
 if ! [[ -n "$WORKSPACE" ]]; then
   echo "WORKSPACE environment variable not set"
@@ -41,6 +61,14 @@ if [[ "$REVISION" != '' ]]; then
   git checkout $REVISION
 fi
 
+ECODE=$?
+
+if [[ "$ECODE" != "0" ]]; then
+  title "!!!!!! DIAGNOSTICS FAILED (`timer`) !!!!!!"
+  EXITCODE=$(($EXITCODE + $ECODE))
+  exit $EXITCODE
+fi
+
 cp -f /home/jenkins/diagnostics/arvados-workbench/$INSTANCE-application.yml $WORKSPACE/apps/workbench/config/application.yml
 
 cd $WORKSPACE/apps/workbench
@@ -51,12 +79,17 @@ if [[ ! -d tmp ]]; then
   mkdir tmp
 fi
 
-RAILS_ENV=diagnostics bundle exec rake TEST=test/diagnostics/pipeline_test.rb
+if [ $INSTANCE == '9tee4' ] 
+then
+    RAILS_ENV=diagnostics bundle exec rake TEST=test/diagnostics/container_request_test.rb
+else
+    RAILS_ENV=diagnostics bundle exec rake TEST=test/diagnostics/pipeline_test.rb
+fi
 
 ECODE=$?
 
 if [[ "$REVISION" != '' ]]; then
-  git checkout master
+  git checkout main
 fi
 
 if [[ "$ECODE" != "0" ]]; then