Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize the use of a prestart.sh script inside Test Collections #20

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Fetch yaml tests and runner
run: |
source $(poetry env info --path)/bin/activate
./test_collections/sdk_tests/fetch_sdk_tests_and_runner.sh
./test_collections/sdk_tests/scripts/fetch_sdk_tests_and_runner.sh
env:
SERVER_NAME: localhost
SERVER_HOST: http://localhost
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -e
# Otherwise a temporary checkout of matter sdk will be made.

# Paths
ROOT_DIR=$(realpath $(dirname "$0")/../..)
ROOT_DIR=$(realpath $(dirname "$0")/../../..)
TEST_YAML_LOCK_PATH="$ROOT_DIR/.lock-test-yaml"
TMP_SDK_FOLDER="sdk-sparse"
TMP_SDK_PATH="/tmp/$TMP_SDK_FOLDER"
Expand Down
Loading