Skip to content

Commit

Permalink
add test file into test matrix only when the file still exist
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue committed Dec 20, 2024
1 parent 40a55a8 commit cde85ca
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/scripts/get_test_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ function find_test_1() {
function find_test_2() {
test_files=$(printf '%s\n' "${changed_files[@]}" | grep -E "*.sh") || true
for test_file in ${test_files}; do
_service=$(echo $test_file | cut -d'/' -f3 | cut -d'.' -f1 | cut -c6-)
if [ $(echo ${_service} | grep -c "_on_") == 0 ]; then
service=${_service}
hardware="intel_cpu"
else
hardware=${_service#*_on_}
fi
if [[ $(echo ${run_matrix} | grep -c "{\"service\":\"${_service}\",\"hardware\":\"${hardware}\"},") == 0 ]]; then
run_matrix="${run_matrix}{\"service\":\"${_service}\",\"hardware\":\"${hardware}\"},"
if [ -f $test_file ]; then
_service=$(echo $test_file | cut -d'/' -f3 | cut -d'.' -f1 | cut -c6-)
if [ $(echo ${_service} | grep -c "_on_") == 0 ]; then
service=${_service}
hardware="intel_cpu"
else
hardware=${_service#*_on_}
fi
if [[ $(echo ${run_matrix} | grep -c "{\"service\":\"${_service}\",\"hardware\":\"${hardware}\"},") == 0 ]]; then
run_matrix="${run_matrix}{\"service\":\"${_service}\",\"hardware\":\"${hardware}\"},"
fi
fi
done
}
Expand Down

0 comments on commit cde85ca

Please sign in to comment.