diff --git a/prestart.sh b/prestart.sh index accd9d67..d2cb7021 100755 --- a/prestart.sh +++ b/prestart.sh @@ -24,5 +24,10 @@ alembic upgrade head # Create initial data in DB python ./app/initial_data.py -# Update SDK Tests (YAML and Python Tests) -./test_collections/sdk_tests/fetch_sdk_tests_and_runner.sh \ No newline at end of file +# Run Prestart scripts in test collections +for dir in ./test_collections/* +do + prestart=$dir/prestart.sh + # Only run prestart.sh if present/ + [ -x $prestart ] && $prestart +done diff --git a/test_collections/sdk_tests/prestart.sh b/test_collections/sdk_tests/prestart.sh new file mode 100755 index 00000000..e0311324 --- /dev/null +++ b/test_collections/sdk_tests/prestart.sh @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + + # + # Copyright (c) 2023 Project CHIP Authors + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + # Paths +SDK_TESTS_DIR=$(dirname "$0") +cd $SDK_TESTS_DIR + +# Fetch code from SDK +./scripts/fetch_sdk_tests_and_runner.sh \ No newline at end of file diff --git a/test_collections/sdk_tests/fetch_sdk_tests_and_runner.sh b/test_collections/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh similarity index 100% rename from test_collections/sdk_tests/fetch_sdk_tests_and_runner.sh rename to test_collections/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh