@@ -5,11 +5,12 @@ ANY_FAILED=false
55
66MODEL_LIST_KEY=" model-list"
77FEATURE_LIST_KEY=" feature-list"
8+ DEFAULT_FEATURES_FILE=" .buildkite/features/default_features.txt"
89
910# Note: This script assumes the metadata keys contain newline-separated lists.
1011# The `mapfile` command reads these lists into arrays, correctly handling spaces.
1112mapfile -t model_list < <( buildkite-agent meta-data get " ${MODEL_LIST_KEY} " --default " " )
12- mapfile -t feature_list < <( buildkite-agent meta-data get " ${FEATURE_LIST_KEY} " --default " " )
13+ mapfile -t metadata_feature_list < <( buildkite-agent meta-data get " ${FEATURE_LIST_KEY} " --default " " )
1314MODEL_STAGES=(" UnitTest" " IntegrationTest" " Benchmark" )
1415FEATURE_STAGES=(" CorrectnessTest" " PerformanceTest" )
1516
@@ -20,8 +21,18 @@ echo "Model,UnitTest,IntegrationTest,Benchmark" > "$model_support_matrix_csv"
2021feature_support_matrix_csv=" feature_support_matrix.csv"
2122echo " Feature,CorrectnessTest,PerformanceTest" > " $feature_support_matrix_csv "
2223
24+ # Read the list of default features from the specified file
25+ if [[ -f " ${DEFAULT_FEATURES_FILE} " ]]; then
26+ mapfile -t default_feature_list < <( sed ' s/\r$//; /^$/d' " ${DEFAULT_FEATURES_FILE} " )
27+ else
28+ default_feature_list=()
29+ echo " Warning: Default features file not found at ${DEFAULT_FEATURES_FILE} "
30+ fi
31+
2332process_models () {
24- for model in " $@ " ; do
33+ local row
34+ local result
35+ for model in " ${model_list[@]:- } " ; do
2536 row=" \" $model \" "
2637 for stage in " ${MODEL_STAGES[@]} " ; do
2738 result=$( buildkite-agent meta-data get " ${model} :${stage} " --default " N/A" )
@@ -35,25 +46,46 @@ process_models() {
3546}
3647
3748process_features () {
38- for feature in " $@ " ; do
39- row=" \" $feature \" "
49+ declare -A feature_rows
50+ local result
51+ # Process features from the default list
52+ for feature in " ${default_feature_list[@]:- } " ; do
53+ if [[ -z " $feature " ]]; then continue ; fi
54+ local row=" \" $feature \" "
55+ for stage in " ${FEATURE_STAGES[@]} " ; do
56+ result=" ✅"
57+ row=" $row ,$result "
58+ done
59+ feature_rows[" $feature " ]=" $row "
60+ done
61+ # Process features from the metadata list
62+ for feature in " ${metadata_feature_list[@]:- } " ; do
63+ if [[ -z " $feature " ]]; then continue ; fi
64+ if [[ -v feature_rows[" $feature " ] ]]; then
65+ continue
66+ fi
67+ local row=" \" $feature \" "
4068 for stage in " ${FEATURE_STAGES[@]} " ; do
4169 result=$( buildkite-agent meta-data get " ${feature} :${stage} " --default " N/A" )
4270 row=" $row ,$result "
4371 if [ " ${result} " != " ✅" ] && [ " ${result} " != " N/A" ] ; then
4472 ANY_FAILED=true
4573 fi
4674 done
47- echo " $row " >> " $feature_support_matrix_csv "
75+ feature_rows[ " $feature " ]= " $row "
4876 done
77+ # Output all unique rows, sorted, to the CSV file
78+ for row in " ${feature_rows[@]} " ; do
79+ echo " $row "
80+ done | sort -V >> " $feature_support_matrix_csv "
4981}
5082
5183if [ ${# model_list[@]} -gt 0 ]; then
52- process_models " ${model_list[@]} "
84+ process_models
5385fi
5486
55- if [ ${# feature_list [@]} -gt 0 ]; then
56- process_features " ${feature_list[@]} "
87+ if [ ${# metadata_feature_list[@]} -gt 0 ] || [ ${ # default_feature_list [@]} -gt 0 ]; then
88+ process_features
5789fi
5890
5991buildkite-agent meta-data set " CI_TESTS_FAILED" " ${ANY_FAILED} "
0 commit comments