From 95441ef896079dffd6dad115e76b68539090b356 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 28 Sep 2016 14:39:46 -0400 Subject: [PATCH] move gate hooks to gate/ We prevent a lot of tests from getting run on tools/ changes given that most of that is unrelated to running any tests. By having the gate hooks in that directory it made for somewhat odd separation of what is test sensitive and what is not. This moves things to the gate/ top level directory, and puts a symlink in place to handle project-config compatibility until that can be updated. Change-Id: Iec9e89f0380256c1ae8df2d19c547d67bbdebd65 --- {tools/hooks => gate}/README | 0 gate/post_test_hook.sh | 21 +++++++++++++++++++++ tools/hooks/post_test_hook.sh | 22 +--------------------- 3 files changed, 22 insertions(+), 21 deletions(-) rename {tools/hooks => gate}/README (100%) create mode 100755 gate/post_test_hook.sh mode change 100755 => 120000 tools/hooks/post_test_hook.sh diff --git a/tools/hooks/README b/gate/README similarity index 100% rename from tools/hooks/README rename to gate/README diff --git a/gate/post_test_hook.sh b/gate/post_test_hook.sh new file mode 100755 index 000000000000..5f72eb378d75 --- /dev/null +++ b/gate/post_test_hook.sh @@ -0,0 +1,21 @@ +#!/bin/bash -x + +MANAGE="/usr/local/bin/nova-manage" + +function archive_deleted_rows { + # NOTE(danms): Run this a few times to make sure that we end + # up with nothing more to archive + for i in `seq 30`; do + $MANAGE db archive_deleted_rows --verbose --max_rows 1000 + RET=$? + if [[ $RET -gt 1 ]]; then + echo Archiving failed with result $RET + return $RET + elif [[ $RET -eq 0 ]]; then + echo Archiving Complete + break; + fi + done +} + +archive_deleted_rows diff --git a/tools/hooks/post_test_hook.sh b/tools/hooks/post_test_hook.sh deleted file mode 100755 index 5f72eb378d75..000000000000 --- a/tools/hooks/post_test_hook.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -x - -MANAGE="/usr/local/bin/nova-manage" - -function archive_deleted_rows { - # NOTE(danms): Run this a few times to make sure that we end - # up with nothing more to archive - for i in `seq 30`; do - $MANAGE db archive_deleted_rows --verbose --max_rows 1000 - RET=$? - if [[ $RET -gt 1 ]]; then - echo Archiving failed with result $RET - return $RET - elif [[ $RET -eq 0 ]]; then - echo Archiving Complete - break; - fi - done -} - -archive_deleted_rows diff --git a/tools/hooks/post_test_hook.sh b/tools/hooks/post_test_hook.sh new file mode 120000 index 000000000000..c659cde4946c --- /dev/null +++ b/tools/hooks/post_test_hook.sh @@ -0,0 +1 @@ +../../gate/post_test_hook.sh \ No newline at end of file