Skip to content

Commit

Permalink
standardize the use of a prestart.sh script inside test_collections
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelhm committed Nov 8, 2023
1 parent 48ad49b commit 74b278e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
9 changes: 7 additions & 2 deletions prestart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# 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
23 changes: 23 additions & 0 deletions test_collections/sdk_tests/prestart.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 74b278e

Please sign in to comment.