Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1926 from twobraids/rabbit-offal

fixes Bug 978363 - ensure rabbitmq is empty before doing any tests that touch it
  • Loading branch information...
commit fe2ae0091901d568f88a6093727a444d877bb51e 2 parents 5c7995e + afad5c2
@lonnen lonnen authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 scripts/rabbitmq-integration-test.sh
View
19 scripts/rabbitmq-integration-test.sh
@@ -51,10 +51,17 @@ then
RABBITMQ_VHOST="/"
fi
+function cleanup_rabbitmq() {
+ echo -n "INFO: Purging rabbitmq queue 'socorro.normal'..."
+ python scripts/test_rabbitmq.py --test_rabbitmq.purge='socorro.normal' --test_rabbitmq.rabbitmq_host=$RABBITMQ_HOST --test_rabbitmq.rabbitmq_user=$RABBITMQ_USERNAME --test_rabbitmq.rabbitmq_password=$RABBITMQ_PASSWORD --test_rabbitmq.rabbitmq_vhost=$RABBITMQ_VHOST > /dev/null 2>&1
+ echo " Done."
+ echo -n "INFO: Purging rabbitmq queue 'socorro.priority'..."
+ python scripts/test_rabbitmq.py --test_rabbitmq.purge='socorro.priority' --test_rabbitmq.rabbitmq_host=$RABBITMQ_HOST --test_rabbitmq.rabbitmq_user=$RABBITMQ_USERNAME --test_rabbitmq.rabbitmq_password=$RABBITMQ_PASSWORD --test_rabbitmq.rabbitmq_vhost=$RABBITMQ_VHOST > /dev/null 2>&1
+ echo " Done."
+}
function cleanup() {
- echo "INFO: Purging rabbitmq queue"
- python scripts/test_rabbitmq.py --test_rabbitmq.purge='socorro.normal' --test_rabbitmq.rabbitmq_host=$RABBITMQ_HOST --test_rabbitmq.rabbitmq_user=$RABBITMQ_USERNAME --test_rabbitmq.rabbitmq_password=$RABBITMQ_PASSWORD --test_rabbitmq.rabbitmq_vhost=$RABBITMQ_VHOST > /dev/null 2>&1
+ cleanup_rabbitmq
echo "INFO: cleaning up crash storage directories"
rm -rf ./primaryCrashStore/ ./processedCrashStore/
@@ -106,8 +113,14 @@ if [ $? != 0 ]
then
fatal 1 "setupdb_app.py failed, check setupdb.log"
fi
+echo " Done."
popd >> setupdb.log 2>&1
-python socorro/cron/crontabber.py --database.database_hostname=$DB_HOST --database.database_username=$DB_USER --database.database_password=$DB_PASSWORD --job=weekly-reports-partitions --force >> setupdb.log 2>&1
+
+# ensure rabbitmq is really empty and no previous failure left garbage
+cleanup_rabbitmq
+
+echo -n "INFO: setting up 'weekly-reports-partitions' via crontabber..."
+python socorro/cron/crontabber.py --resource.postgresql.database_hostname=$DB_HOST --secrets.postgresql.database_username=$DB_USER --secrets.postgresql.database_password=$DB_PASSWORD --job=weekly-reports-partitions --force >> setupdb.log 2>&1
if [ $? != 0 ]
then
fatal 1 "crontabber weekly-reports-partitions failed, check setupdb.log"
Please sign in to comment.
Something went wrong with that request. Please try again.