Skip initializer tests for pre-releases

This commit is contained in:
Tobias Genannt 2022-07-21 08:47:56 +02:00
parent e62fedbd5e
commit ec35446b65
2 changed files with 16 additions and 1 deletions

View File

@ -43,6 +43,10 @@ jobs:
- id: docker-build
name: Build the image with '${{ matrix.build_cmd }}'
run: ${{ matrix.build_cmd }}
- id: test-configuration
name: Set ENV variable to skip initializer tests for prereleases
if: ${{ contains(matrix.build_cmd, 'PRERELEASE=true') || contains(matrix.build_cmd, 'feature') }}
run: echo "SKIP_INITIALIZER_TESTS=true" >>"${GITHUB_ENV}"
- id: test-image
name: Test the image
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh

13
test.sh
View File

@ -14,6 +14,8 @@
# exit when a command exits with an exit code != 0
set -e
source ./build-functions/gh-functions.sh
# IMAGE is used by `docker-compose.yml` do determine the tag
# of the Docker Image that is to be used
if [ "${1}x" != "x" ]; then
@ -80,7 +82,16 @@ echo "🐳🐳🐳 Start testing '${IMAGE}'"
trap test_cleanup EXIT ERR
test_setup
gh_echo "::group::Netbox unit tests"
test_netbox_unit_tests
test_initializers
gh_echo "::endgroup::"
gh_echo "::group::Innitializer tests"
if [ "$SKIP_INITIALIZER_TESTS" == "true" ]; then
echo "↩️ Skipping initializer tests"
else
test_initializers
fi
gh_echo "::endgroup::"
echo "🐳🐳🐳 Done testing '${IMAGE}'"