You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/11 12:50:44 UTC

[GitHub] [airflow] potiuk opened a new pull request #11417: Selective tests 2nd attempt

potiuk opened a new pull request #11417:
URL: https://github.com/apache/airflow/pull/11417


   NOTE For reviewer - this is based on #11402 so review only last commit.
   
   This is final step of implementing #10507 - selective tests.
   Depending on files changed by the incoming commit, only subset of
   the tests are exucted. The conditions below are evaluated in the
   sequence specified below as well:
   
   * In case of "push" and "schedule" type of events, all tests
     are executed.
   
   * If no important files and folders changed - no tests are executed.
     This is a typical case for doc-only changes.
   
   * If any of the environment files (Dockerfile/setup.py etc.) all
     tests are executed.
   
   * If no "core/other" files are changed, only the relevant types
     of tests are executed:
   
     * API - if any of the API files/tests changed
     * CLI - if any of the CLI files/tests changed
     * WWW - if any of the WWW files/tests changed
     * Providers - if any of the Providers files/tests changed
   
   * If "Kubernetes" related files/tests are changed, the
     "Kubernetes" tests with Kind are run. Note that those tests
     are run separately using Host environment and those tests
     are stored in "kubernetes_tests" folder.
   
   * If some of the core/other files change, all tests are run. This
     is calculated by substracting all the files count calculated
     above from the total count of important files.
   
   Fixes: #10507
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #11417: Selective tests 2nd attempt

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #11417:
URL: https://github.com/apache/airflow/pull/11417#discussion_r502912358



##########
File path: scripts/ci/selective_tests.sh
##########
@@ -0,0 +1,324 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+# shellcheck source=scripts/ci/libraries/_script_init.sh
+. ./scripts/ci/libraries/_script_init.sh
+
+declare -a pattern_array
+
+function output_all_basic_variables() {
+    initialization::ga_output python-versions \
+        "$(initialization::parameters_to_json "${CURRENT_PYTHON_MAJOR_MINOR_VERSIONS[@]}")"
+    initialization::ga_output default-python-version "${DEFAULT_PYTHON_MAJOR_MINOR_VERSION}"
+
+    initialization::ga_output kubernetes-versions \
+        "$(initialization::parameters_to_json "${CURRENT_KUBERNETES_VERSIONS[@]}")"
+    initialization::ga_output default-kubernetes-version "${KUBERNETES_VERSION}"
+
+    initialization::ga_output kubernetes-modes \
+        "$(initialization::parameters_to_json "${CURRENT_KUBERNETES_MODES[@]}")"
+    initialization::ga_output default-kubernetes-mode "${KUBERNETES_MODE}"
+
+    initialization::ga_output postgres-versions \
+        "$(initialization::parameters_to_json "${CURRENT_POSTGRES_VERSIONS[@]}")"
+    initialization::ga_output default-postgres-version "${POSTGRES_VERSION}"
+
+    initialization::ga_output mysql-versions \
+        "$(initialization::parameters_to_json "${CURRENT_MYSQL_VERSIONS[@]}")"
+    initialization::ga_output default-mysql-version "${MYSQL_VERSION}"
+
+    initialization::ga_output kind-versions \
+        "$(initialization::parameters_to_json "${CURRENT_KIND_VERSIONS[@]}")"
+    initialization::ga_output default-kind-version "${KIND_VERSION}"
+
+    initialization::ga_output helm-versions \
+        "$(initialization::parameters_to_json "${CURRENT_HELM_VERSIONS[@]}")"
+    initialization::ga_output default-helm-version "${HELM_VERSION}"
+
+    initialization::ga_output postgres-exclude '[{ "python-version": "3.6" }]'

Review comment:
       If we have as many savings as I think we will, we can likely even bring back those python variants.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #11417: Selective tests - depends on files changed in the commit.

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #11417:
URL: https://github.com/apache/airflow/pull/11417#issuecomment-706776191


   Would be great to merge this one for the coming weel  - it will significantly decrease the strain on the GA.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #11417: Selective tests 2nd attempt

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #11417:
URL: https://github.com/apache/airflow/pull/11417#discussion_r502912358



##########
File path: scripts/ci/selective_tests.sh
##########
@@ -0,0 +1,324 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+# shellcheck source=scripts/ci/libraries/_script_init.sh
+. ./scripts/ci/libraries/_script_init.sh
+
+declare -a pattern_array
+
+function output_all_basic_variables() {
+    initialization::ga_output python-versions \
+        "$(initialization::parameters_to_json "${CURRENT_PYTHON_MAJOR_MINOR_VERSIONS[@]}")"
+    initialization::ga_output default-python-version "${DEFAULT_PYTHON_MAJOR_MINOR_VERSION}"
+
+    initialization::ga_output kubernetes-versions \
+        "$(initialization::parameters_to_json "${CURRENT_KUBERNETES_VERSIONS[@]}")"
+    initialization::ga_output default-kubernetes-version "${KUBERNETES_VERSION}"
+
+    initialization::ga_output kubernetes-modes \
+        "$(initialization::parameters_to_json "${CURRENT_KUBERNETES_MODES[@]}")"
+    initialization::ga_output default-kubernetes-mode "${KUBERNETES_MODE}"
+
+    initialization::ga_output postgres-versions \
+        "$(initialization::parameters_to_json "${CURRENT_POSTGRES_VERSIONS[@]}")"
+    initialization::ga_output default-postgres-version "${POSTGRES_VERSION}"
+
+    initialization::ga_output mysql-versions \
+        "$(initialization::parameters_to_json "${CURRENT_MYSQL_VERSIONS[@]}")"
+    initialization::ga_output default-mysql-version "${MYSQL_VERSION}"
+
+    initialization::ga_output kind-versions \
+        "$(initialization::parameters_to_json "${CURRENT_KIND_VERSIONS[@]}")"
+    initialization::ga_output default-kind-version "${KIND_VERSION}"
+
+    initialization::ga_output helm-versions \
+        "$(initialization::parameters_to_json "${CURRENT_HELM_VERSIONS[@]}")"
+    initialization::ga_output default-helm-version "${HELM_VERSION}"
+
+    initialization::ga_output postgres-exclude '[{ "python-version": "3.6" }]'

Review comment:
       If we have as many savings as I think we will, we can likely even bring back all python variants for all tests.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk merged pull request #11417: Selective tests - depends on files changed in the commit.

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #11417:
URL: https://github.com/apache/airflow/pull/11417


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #11417: Selective tests - depends on files changed in the commit.

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #11417:
URL: https://github.com/apache/airflow/pull/11417#issuecomment-706733214


   Hello everyone - this one is ready for review and it looks like it works as expected:
   
   You can see all the 13 different cases where I tested small changes in some of the combinations: 
   
   https://github.com/potiuk/airflow/pulls
   
   Examples: 
   
   * API changes: https://github.com/potiuk/airflow/pull/113 when there are only API files changed -51 checks are run rather than 110.
   * When important files such as setup.py are changed - all tests are run : https://github.com/potiuk/airflow/pull/124
   * When you push directly to master (that's how merge works), all tests are run: https://github.com/potiuk/airflow/runs/1238562869?check_suite_focus=true#step:5:452 (I cancelled this one but you can see tht it would run all tests)
   * When there is a kubernetes_tests/chart related change it will run Kubernetes tests: https://github.com/potiuk/airflow/pull/121 and https://github.com/potiuk/airflow/pull/122
   * When there are providers-only changes (or provider tests) https://github.com/potiuk/airflow/pull/117/  also ~ 60 checks are run (but this time the Providers one are among them)
   * When there is a combined change with several directories - it will run all relevant tests: https://github.com/potiuk/airflow/pull/125
   
   
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #11417: Selective tests 2nd attempt

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #11417:
URL: https://github.com/apache/airflow/pull/11417#issuecomment-706700897


   I am still testing that one in my private fork (https://github.com/potiuk/airflow/pulls). There are 12 pull requests that (I hope) should run faster or longer, and have more or less checks depending on the files that are changed in the upcoming commit. 
   
   This is final step of implementing #10507  and I think this will be ultimate saver on the job queues that we have in Github Actions - and for most contributors it will significantly speed up the feedback time - if they only change docs + some of the providers for example. I will use the linked 12 PRs from my fork  to make sure that it works as expected before merging but I am happy to get reviews before. 


----------------------------------------------------------------
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:
users@infra.apache.org