From fb608410471921b0d6d636164ac8f982457f4a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Tue, 15 Oct 2019 00:53:36 +0200 Subject: [PATCH] Only test 'latest' in PRs Because it's the only tag being built --- hooks/test | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/hooks/test b/hooks/test index f741c45..1dd5538 100755 --- a/hooks/test +++ b/hooks/test @@ -2,14 +2,21 @@ . hooks/common -# test 'branches' and 'this' (i.e. pull request) builds -if [ "${BUILD}" == "branches" ] \ - || [ "${BUILD}" == "this" ] \ - || [ "${DEBUG}" == "true" ]; then - echo "🐳🐳🐳 Testing" - VERSION=latest docker-compose run netbox ./manage.py test - VERSION=snapshot docker-compose run netbox ./manage.py test +run_test() { + echo "🐳🐳🐳 Testing '${1}'" + VERSION="${1}" docker-compose run netbox ./manage.py test docker-compose down -v + echo "🐳🐳🐳 Done testing '${1}'" +} + +# test on builds of 'branches' +if [ "${BUILD}" == "branches" ] \ + || [ "${DEBUG}" == "true" ]; then + run_test latest + run_test snapshot +# test on bulds of 'this' (i.e. pull request) +elif [ "${BUILD}" == "this" ]; then + run_test latest else echo "🐳🐳🐳 No tests are implemented for build '${BUILD}'." fi