ashb commented on a change in pull request #11541:
URL: https://github.com/apache/airflow/pull/11541#discussion_r505411650



##########
File path: scripts/ci/selective_tests.sh
##########
@@ -125,18 +182,60 @@ function count_changed_files() {
     echo "${count_changed_files}"
 }
 
-function run_all_tests_when_push_or_schedule() {
+function run_everything_when_push_or_schedule() {
     if [[ ${GITHUB_EVENT_NAME} == "push" || ${GITHUB_EVENT_NAME} == "schedule" 
]]; then
         echo
         echo "Always run all tests in case of push/schedule events"
         echo
-        set_outputs_run_all_tests
-        exit
+        set_outputs_run_everything_and_exit
+    fi
+}
+
+function check_if_api_tests_should_be_run() {
+    local api_triggering_patterns=(
+        "^airflow/api"
+    )
+    pattern_array=("${api_triggering_patterns[@]}")
+    show_changed_files "$(get_regexp_from_patterns)"
+
+    if [[ $(count_changed_files) == "0" ]]; then
+        does_not_need_api_tests
+    else
+        needs_api_tests
+    fi
+}
+
+function check_if_helm_tests_should_be_run() {
+    local helm_triggering_patterns=(
+        "^chart"
+    )
+    pattern_array=("${helm_triggering_patterns[@]}")
+    show_changed_files "$(get_regexp_from_patterns)"
+
+    if [[ $(count_changed_files) == "0" ]]; then
+        does_not_need_helm_tests
+    else
+        needs_helm_tests
+    fi
+}
+
+function check_if_docs_should_be_generated() {
+    local docs_triggering_patterns=(
+        "^docs$"
+        "\.py$"
+    )
+    pattern_array=("${docs_triggering_patterns[@]}")
+    show_changed_files "$(get_regexp_from_patterns)"
+
+    if [[ $(count_changed_files) == "0" ]]; then
+        echo "None of the docs changed"
+    else
+        image_build_needed="true"
     fi
 }
 
 function check_if_tests_should_be_run_at_all() {
-    TEST_TRIGGERING_PATTERNS=(
+    local api_triggering_patterns=(

Review comment:
       Could this fn not be reimplemented instead to just check that none of 
the previous selective tests ran anything? Saves having to keep multiple things 
in sync.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to