[CI] Introduce testing for IDF 5 (and other arbitrary framework versions) (#6802)

* Initial changes to support testing of additional framework versions

* Rename Arduino test files
This commit is contained in:
Keith Burzinski 2024-06-17 16:32:11 -05:00 committed by GitHub
parent a59c9b4f77
commit f6848fe24d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1689 changed files with 95 additions and 16 deletions

View File

@ -24,8 +24,8 @@ fi
start_esphome() { start_esphome() {
# create dynamic yaml file in `build` folder. # create dynamic yaml file in `build` folder.
# `./tests/test_build_components/build/[target_component].[test_name].[target_platform].yaml` # `./tests/test_build_components/build/[target_component].[test_name].[target_platform_with_version].yaml`
component_test_file="./tests/test_build_components/build/$target_component.$test_name.$target_platform.yaml" component_test_file="./tests/test_build_components/build/$target_component.$test_name.$target_platform_with_version.yaml"
cp $target_platform_file $component_test_file cp $target_platform_file $component_test_file
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
@ -36,7 +36,7 @@ start_esphome() {
fi fi
# Start esphome process # Start esphome process
echo "> [$target_component] [$test_name] [$target_platform]" echo "> [$target_component] [$test_name] [$target_platform_with_version]"
set -x set -x
# TODO: Validate escape of Command line substitution value # TODO: Validate escape of Command line substitution value
python -m esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file python -m esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file
@ -76,16 +76,17 @@ for f in ./tests/components/$target_component/*.*.yaml; do
# 2. `./tests/test_build_components/build_components_base.[target_platform]-ard.yaml` # 2. `./tests/test_build_components/build_components_base.[target_platform]-ard.yaml`
target_platform_file="./tests/test_build_components/build_components_base.$target_platform.yaml" target_platform_file="./tests/test_build_components/build_components_base.$target_platform.yaml"
if ! [ -f "$target_platform_file" ]; then if ! [ -f "$target_platform_file" ]; then
# Try find arduino test framework as platform. echo "No base test file [./tests/test_build_components/build_components_base.$target_platform.yaml] for component test [$f] found."
target_platform_ard="$target_platform-ard" exit 1
target_platform_file="./tests/test_build_components/build_components_base.$target_platform_ard.yaml"
if ! [ -f "$target_platform_file" ]; then
echo "No base test file [./tests/test_build_components/build_components_base.$target_platform.yaml, ./tests/build_components_base.$target_platform_ard.yaml] for component test [$f] found."
exit 1
fi
target_platform=$target_platform_ard
fi fi
start_esphome for target_platform_file in ./tests/test_build_components/build_components_base.$target_platform*.yaml; do
# trim off "./tests/test_build_components/build_components_base." prefix
target_platform_with_version=${target_platform_file:52}
# ...now remove suffix starting with "." leaving just the test target hardware and software platform (possibly with version)
# For example: "esp32-s3-idf-50"
target_platform_with_version=${target_platform_with_version%.*}
start_esphome
done
fi fi
done done

Some files were not shown because too many files have changed in this diff Show More