You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "gopidesupavan (via GitHub)" <gi...@apache.org> on 2024/11/24 12:41:10 UTC

[PR] Move OpenAPI tests to breeze container [airflow]

gopidesupavan opened a new pull request, #44326:
URL: https://github.com/apache/airflow/pull/44326

   closes: #44020 
   
   Running Open API client tests directly in the runner environment is fragile due to the need for manual installation of Airflow and providers, which can cause dependency conflicts and installation errors. Breeze offers a consistent, containerized setup.
   
   Moving openapi tests run inside breeze container. Breeze uses a pre-configured container image, avoiding the need for manual installation of Airflow and providers in the runner
   
   
   <!--
    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.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+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 a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1857390928


##########
Dockerfile.ci:
##########
@@ -1155,12 +1155,48 @@ function check_force_lowest_dependencies() {
     set +x
 }
 
+function check_airflow_python_client_installation() {
+    if [[ ${INSTALL_AIRFLOW_PYTHON_CLIENT=} != "true" ]]; then
+        return
+    fi
+    python "${IN_CONTAINER_DIR}/install_airflow_python_client.py"
+}
+
+function start_airflow_minimal_webserver_with_examples(){
+    if [[ ${START_AIRFLOW_MINIMAL_WEBSERVER_WITH_EXAMPLES=} != "true" ]]; then
+        return
+    fi
+    export AIRFLOW__CORE__LOAD_EXAMPLES=True
+    export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.session,airflow.providers.fab.auth_manager.api.auth.backend.basic_auth
+    export AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
+    echo
+    echo "${COLOR_BLUE}Initializing database${COLOR_RESET}"
+    echo
+    airflow db migrate
+    echo
+    echo "${COLOR_BLUE}Database initialized${COLOR_RESET}"
+    echo
+    echo "${COLOR_BLUE}Parsing example dags${COLOR_RESET}"
+    echo
+    airflow scheduler --num-runs 100

Review Comment:
   Why 100 runs? How did you get to this number?



##########
Dockerfile.ci:
##########
@@ -1155,12 +1155,48 @@ function check_force_lowest_dependencies() {
     set +x
 }
 
+function check_airflow_python_client_installation() {
+    if [[ ${INSTALL_AIRFLOW_PYTHON_CLIENT=} != "true" ]]; then
+        return
+    fi
+    python "${IN_CONTAINER_DIR}/install_airflow_python_client.py"
+}
+
+function start_airflow_minimal_webserver_with_examples(){
+    if [[ ${START_AIRFLOW_MINIMAL_WEBSERVER_WITH_EXAMPLES=} != "true" ]]; then
+        return
+    fi
+    export AIRFLOW__CORE__LOAD_EXAMPLES=True
+    export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.session,airflow.providers.fab.auth_manager.api.auth.backend.basic_auth
+    export AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
+    echo
+    echo "${COLOR_BLUE}Initializing database${COLOR_RESET}"
+    echo
+    airflow db migrate
+    echo
+    echo "${COLOR_BLUE}Database initialized${COLOR_RESET}"
+    echo
+    echo "${COLOR_BLUE}Parsing example dags${COLOR_RESET}"
+    echo
+    airflow scheduler --num-runs 100
+    echo "Example dags parsing finished"
+    echo "Create admin user"
+    airflow users create -u admin -p admin -f Thor -l Administrator -r Admin -e admin@email.domain
+    echo "Admin user created"
+    echo
+    echo "${COLOR_BLUE}Starting airflow webserver${COLOR_RESET}"
+    echo
+    airflow webserver --port 8080 --daemon && sleep 60

Review Comment:
   Starting webserver and having a static sleep is a bit dangerous. Can you check in comparison how it was made for internal API tests in `scripts/docker/entrypoint_ci.sh:332` ? I think the start and poll for HTTP port is more safe.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1860526296


##########
.github/workflows/special-tests.yml:
##########
@@ -76,10 +76,16 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to debug resources or not (true/false)"
         required: true
         type: string
+      special-tests-required:

Review Comment:
   But .... do we need it INSIDE as well? Now that all the tests have the same if ? We can remove it altogether :D? 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859532015


##########
dev/breeze/doc/05_test_commands.rst:
##########
@@ -218,6 +218,29 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
   :alt: Breeze testing providers-integration-tests
 
 
+Running OpenAPI Client tests
+...................................
+
+To run OpenAPI Client tests, you need to have airflow python client packaged in dist folder.
+To package the client, clone the airflow-python-client repository and run the following command:
+
+.. code-block:: bash
+
+   breeze release-management prepare-python-client --package-format both

Review Comment:
   make sense i have updated now :)



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1855529063


##########
.github/workflows/special-tests.yml:
##########
@@ -247,3 +262,50 @@ jobs:
       include-success-outputs: ${{ inputs.include-success-outputs }}
       run-coverage: ${{ inputs.run-coverage }}
       debug-resources: ${{ inputs.debug-resources }}
+
+  test-openapi-client:

Review Comment:
   Open api tests requires building the airflow python client, so i have added as a separate job here and once it packaged and calling the breeze testing within same job. hope that is okay? 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1860528663


##########
.github/workflows/ci.yml:
##########
@@ -505,6 +508,12 @@ jobs:
       upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
       include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
       debug-resources: ${{ needs.build-info.outputs.debug-resources }}
+      special-tests-required: ${{

Review Comment:
   As discussed below - we can likely remove it back completely  - it's a duplication with the above if now, and I bet we will forget to update it in the future if anything changes, so better to remove it.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2496014130

   Full tests not triggering , might be because of changes to workflows? @potiuk does this change need to come from the apache repo?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2498845763

   <img width="1461" alt="image" src="https://github.com/user-attachments/assets/65d94c1b-b3ba-42ce-b00c-80a5eb9ca153">
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859385264


##########
dev/breeze/doc/05_test_commands.rst:
##########
@@ -218,6 +218,29 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
   :alt: Breeze testing providers-integration-tests
 
 
+Running OpenAPI Client tests
+...................................
+
+To run OpenAPI Client tests, you need to have airflow python client packaged in dist folder.
+To package the client, clone the airflow-python-client repository and run the following command:
+
+.. code-block:: bash
+
+   breeze release-management prepare-python-client --package-format both
+          --version-suffix-for-pypi dev0 --python-client-repo ./airflow-client-python
+
+.. code-block:: bash
+
+   breeze testing openapi-tests

Review Comment:
   yeah fine, i can update :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859383290


##########
dev/breeze/doc/05_test_commands.rst:
##########
@@ -218,6 +218,29 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
   :alt: Breeze testing providers-integration-tests
 
 
+Running OpenAPI Client tests

Review Comment:
   Possibly we should change it to "Python API client tests" here and in CI jobs. It's more accurate description.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1857446705


##########
Dockerfile.ci:
##########
@@ -1155,12 +1155,48 @@ function check_force_lowest_dependencies() {
     set +x
 }
 
+function check_airflow_python_client_installation() {
+    if [[ ${INSTALL_AIRFLOW_PYTHON_CLIENT=} != "true" ]]; then
+        return
+    fi
+    python "${IN_CONTAINER_DIR}/install_airflow_python_client.py"
+}
+
+function start_airflow_minimal_webserver_with_examples(){
+    if [[ ${START_AIRFLOW_MINIMAL_WEBSERVER_WITH_EXAMPLES=} != "true" ]]; then
+        return
+    fi
+    export AIRFLOW__CORE__LOAD_EXAMPLES=True
+    export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.session,airflow.providers.fab.auth_manager.api.auth.backend.basic_auth
+    export AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
+    echo
+    echo "${COLOR_BLUE}Initializing database${COLOR_RESET}"
+    echo
+    airflow db migrate
+    echo
+    echo "${COLOR_BLUE}Database initialized${COLOR_RESET}"
+    echo
+    echo "${COLOR_BLUE}Parsing example dags${COLOR_RESET}"
+    echo
+    airflow scheduler --num-runs 100

Review Comment:
   ah this was used previously in the openapi tests to load/parse the example dags. used same config. :) 
   
   https://github.com/apache/airflow/blob/main/.github/workflows/basic-tests.yml#L220
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1860535244


##########
.github/workflows/ci.yml:
##########
@@ -505,6 +508,12 @@ jobs:
       upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
       include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
       debug-resources: ${{ needs.build-info.outputs.debug-resources }}
+      special-tests-required: ${{

Review Comment:
   sorry my bad in misinterpreted :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859329851


##########
clients/python/test_python_client.py:
##########
@@ -63,68 +65,77 @@
 # or AIRFLOW__CORE__LOAD_EXAMPLES environment variable set to True
 DAG_ID = "example_bash_operator"
 
-# Enter a context with an instance of the API client
-with airflow_client.client.ApiClient(configuration) as api_client:
-    errors = False
 
-    print("[blue]Getting DAG list")
-    dag_api_instance = dag_api.DAGApi(api_client)
-    try:
-        api_response = dag_api_instance.get_dags()
-        print(api_response)
-    except airflow_client.client.OpenApiException as e:
-        print(f"[red]Exception when calling DagAPI->get_dags: {e}\n")
-        errors = True
-    else:
-        print("[green]Getting DAG list successful")
+# Enter a context with an instance of the API client

Review Comment:
   I like this one is converted to pytest :) :+1: 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859335646


##########
.github/workflows/ci.yml:
##########
@@ -505,6 +500,13 @@ jobs:
       upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
       include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
       debug-resources: ${{ needs.build-info.outputs.debug-resources }}
+      is-special-tests-require: ${{

Review Comment:
   If GitHub supported more workflow file calls, we could have a more flexible way to segregate workflows. However, they currently have a hard limit of 20 :)



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859527524


##########
.github/workflows/special-tests.yml:
##########
@@ -247,3 +262,50 @@ jobs:
       include-success-outputs: ${{ inputs.include-success-outputs }}
       run-coverage: ${{ inputs.run-coverage }}
       debug-resources: ${{ inputs.debug-resources }}
+
+  test-openapi-client:

Review Comment:
   moved the tests to `static-checks-mypy-docs.yml` 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1857443666


##########
scripts/in_container/check_environment.sh:
##########
@@ -28,50 +28,16 @@ EXIT_CODE=0
 # Even if this message might be harmless, it might hide the real reason for the problem
 # Which is the long time needed to start some services, seeing this message might be totally misleading
 # when you try to analyse the problem, that's why it's best to avoid it,
-function run_nc() {

Review Comment:
   @jscheffl i looked at some scripts already have this for connectivity check. so i feel we can re-use making these as a separate functions. so moved these two functions inside `scripts/in_container/check_connectivity.sh`.  and we can use this script.
   
   Now i have called these functions to check the web-server connectivity. WDYT is that fine? :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1860536235


##########
.github/workflows/special-tests.yml:
##########
@@ -76,10 +76,16 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to debug resources or not (true/false)"
         required: true
         type: string
+      special-tests-required:

Review Comment:
   Yeah removed , misinterpreted :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859306134


##########
.github/workflows/ci.yml:
##########
@@ -505,6 +500,13 @@ jobs:
       upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
       include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
       debug-resources: ${{ needs.build-info.outputs.debug-resources }}
+      is-special-tests-require: ${{

Review Comment:
   That's a good idea. But NIT: we do not do `is-` prefix in other conditional parameter. Can we change it to just `special-tests-required` ?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859679630


##########
.github/workflows/special-tests.yml:
##########
@@ -76,10 +76,16 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to debug resources or not (true/false)"
         required: true
         type: string
+      special-tests-required:

Review Comment:
   Better to keep the if before even that workflow is evaluated.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859383751


##########
dev/breeze/doc/05_test_commands.rst:
##########
@@ -218,6 +218,29 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
   :alt: Breeze testing providers-integration-tests
 
 
+Running OpenAPI Client tests
+...................................
+
+To run OpenAPI Client tests, you need to have airflow python client packaged in dist folder.
+To package the client, clone the airflow-python-client repository and run the following command:
+
+.. code-block:: bash
+
+   breeze release-management prepare-python-client --package-format both
+          --version-suffix-for-pypi dev0 --python-client-repo ./airflow-client-python
+
+.. code-block:: bash
+
+   breeze testing openapi-tests

Review Comment:
   ```suggestion
      breeze testing python-api-client-tests
   ```
   
   Maybe?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2496068752

   ah it seems this one:
   
   <img width="1459" alt="image" src="https://github.com/user-attachments/assets/a74a8b40-7e4f-4e51-86ac-0ecd6ccce3c2">
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan closed pull request #44326: Move OpenAPI tests to breeze container
URL: https://github.com/apache/airflow/pull/44326


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2498844148

   > > > Full tests not triggering , might be because of changes to workflows? @potiuk does this change need to come from the apache repo?
   > > 
   > > 
   > > This is fixed after removing openapi tests workflow :)
   > 
   > You don't need to worry with running a couple of attempts - I think this is usual when trying to experiment/model/integrate in Github. If you are afraid, just set the PR to Draft :-D
   > 
   > Otherwise... really looking forward having this test 👍
   
   Yes, this fine now.. working as expected :) 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859382097


##########
dev/breeze/doc/05_test_commands.rst:
##########
@@ -218,6 +218,29 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
   :alt: Breeze testing providers-integration-tests
 
 
+Running OpenAPI Client tests
+...................................
+
+To run OpenAPI Client tests, you need to have airflow python client packaged in dist folder.
+To package the client, clone the airflow-python-client repository and run the following command:
+
+.. code-block:: bash
+
+   breeze release-management prepare-python-client --package-format both

Review Comment:
   One more comment though. I think it would be great to add a separate "python_client_tests.rst"  in https://github.com/apache/airflow/tree/main/contributing-docs/testing (and add a link to it in https://github.com/apache/airflow/blob/main/contributing-docs/09_testing.rst . Currently the tests are not described in "contributing docs" and they should be there.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859330391


##########
dev/breeze/doc/05_test_commands.rst:
##########
@@ -218,6 +218,29 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
   :alt: Breeze testing providers-integration-tests
 
 
+Running OpenAPI Client tests
+...................................
+
+To run OpenAPI Client tests, you need to have airflow python client packaged in dist folder.
+To package the client, clone the airflow-python-client repository and run the following command:
+
+.. code-block:: bash
+
+   breeze release-management prepare-python-client --package-format both

Review Comment:
   Nice!



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859391829


##########
dev/breeze/src/airflow_breeze/commands/testing_commands.py:
##########
@@ -1022,6 +1024,92 @@ def helm_tests(
     sys.exit(result.returncode)
 
 
+@group_for_testing.command(
+    name="openapi-tests",
+    help="Run open api tests.",
+    context_settings=dict(
+        ignore_unknown_options=True,
+        allow_extra_args=True,
+    ),
+)
+@option_install_airflow_python_client

Review Comment:
   Ah i see great point i will update them :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2496067509

   <img width="1701" alt="image" src="https://github.com/user-attachments/assets/1e4c1d3a-f18b-421a-8667-3efe2edda13c">
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859319733


##########
.github/workflows/ci.yml:
##########
@@ -505,6 +500,13 @@ jobs:
       upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
       include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
       debug-resources: ${{ needs.build-info.outputs.debug-resources }}
+      is-special-tests-require: ${{

Review Comment:
   Hmm. After a bit of thinking. one bad side-effect it has is that the whole "special tests" group will be evaluated and shown in the tree of tests for every PR - now for most PRs the whole group is skipped. 
   
   Maybe a better approach will be to move that one to "Static Checks, Mypy Docs" and rename it to something like "CI image checks"  (as the whole group?). The name is already too long:
   
   ![image](https://github.com/user-attachments/assets/7e23c35a-9c4e-42a8-81c1-cd50722f647f)
   
   
   There is a slightly different behaviour for "Special tests" - when special tests fail in "canary" build, the constraints are still updated, and probably there are cases where we want them not to be updated - if for examp[le a new version of a dependency will make the OpenAPI tests to fail.
   
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859331273


##########
.github/workflows/ci.yml:
##########
@@ -505,6 +500,13 @@ jobs:
       upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
       include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
       debug-resources: ${{ needs.build-info.outputs.debug-resources }}
+      is-special-tests-require: ${{

Review Comment:
   ah i see, that make sense. Yeah thats good point, i think naming also well suites :) `CI image checks` 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859530215


##########
scripts/in_container/check_connectivity.sh:
##########
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash

Review Comment:
   Yeah this can be used multiple places so separated :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan merged PR #44326:
URL: https://github.com/apache/airflow/pull/44326


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1857451030


##########
Dockerfile.ci:
##########
@@ -1155,12 +1155,48 @@ function check_force_lowest_dependencies() {
     set +x
 }
 
+function check_airflow_python_client_installation() {
+    if [[ ${INSTALL_AIRFLOW_PYTHON_CLIENT=} != "true" ]]; then
+        return
+    fi
+    python "${IN_CONTAINER_DIR}/install_airflow_python_client.py"
+}
+
+function start_airflow_minimal_webserver_with_examples(){
+    if [[ ${START_AIRFLOW_MINIMAL_WEBSERVER_WITH_EXAMPLES=} != "true" ]]; then
+        return
+    fi
+    export AIRFLOW__CORE__LOAD_EXAMPLES=True
+    export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.session,airflow.providers.fab.auth_manager.api.auth.backend.basic_auth
+    export AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
+    echo
+    echo "${COLOR_BLUE}Initializing database${COLOR_RESET}"
+    echo
+    airflow db migrate
+    echo
+    echo "${COLOR_BLUE}Database initialized${COLOR_RESET}"
+    echo
+    echo "${COLOR_BLUE}Parsing example dags${COLOR_RESET}"
+    echo
+    airflow scheduler --num-runs 100
+    echo "Example dags parsing finished"
+    echo "Create admin user"
+    airflow users create -u admin -p admin -f Thor -l Administrator -r Admin -e admin@email.domain
+    echo "Admin user created"
+    echo
+    echo "${COLOR_BLUE}Starting airflow webserver${COLOR_RESET}"
+    echo
+    airflow webserver --port 8080 --daemon && sleep 60

Review Comment:
   Yeah, great!



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2502165756

   > Added some comments - it looks fantastic in general, but I found a few places where things might be improved. We could also use the opportunity to rename those tests to be "python-api-client-tests" across the board.
   
   cool, thanks those really great improvement suggestions let me have a updates on those :) 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2502160510

   Added some comments - it looks fantastic in general, but I found a few places where things might be improved. We could also use the opportunity to rename those tests to be "python-api-client-tests" across the board. 
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859384263


##########
.github/workflows/special-tests.yml:
##########
@@ -247,3 +262,50 @@ jobs:
       include-success-outputs: ${{ inputs.include-success-outputs }}
       run-coverage: ${{ inputs.run-coverage }}
       debug-resources: ${{ inputs.debug-resources }}
+
+  test-openapi-client:

Review Comment:
   ```suggestion
     test-python-api-client:
   ```



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859358645


##########
scripts/in_container/check_connectivity.sh:
##########
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash

Review Comment:
   :heart: this one to be separated :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859676682


##########
.github/workflows/special-tests.yml:
##########
@@ -76,10 +76,16 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to debug resources or not (true/false)"
         required: true
         type: string
+      special-tests-required:

Review Comment:
   Not really.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1860427403


##########
.github/workflows/special-tests.yml:
##########
@@ -76,10 +76,16 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to debug resources or not (true/false)"
         required: true
         type: string
+      special-tests-required:

Review Comment:
   Yes added if outside :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859533310


##########
clients/python/test_python_client.py:
##########
@@ -63,68 +65,77 @@
 # or AIRFLOW__CORE__LOAD_EXAMPLES environment variable set to True
 DAG_ID = "example_bash_operator"
 
-# Enter a context with an instance of the API client
-with airflow_client.client.ApiClient(configuration) as api_client:
-    errors = False
 
-    print("[blue]Getting DAG list")
-    dag_api_instance = dag_api.DAGApi(api_client)
-    try:
-        api_response = dag_api_instance.get_dags()
-        print(api_response)
-    except airflow_client.client.OpenApiException as e:
-        print(f"[red]Exception when calling DagAPI->get_dags: {e}\n")
-        errors = True
-    else:
-        print("[green]Getting DAG list successful")
+# Enter a context with an instance of the API client

Review Comment:
   Yes agree, add this one :)



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859536324


##########
.github/workflows/special-tests.yml:
##########
@@ -76,10 +76,16 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to debug resources or not (true/false)"
         required: true
         type: string
+      special-tests-required:

Review Comment:
   Is it worth keeping this one ? :)



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859347754


##########
clients/python/test_python_client.py:
##########
@@ -63,68 +65,77 @@
 # or AIRFLOW__CORE__LOAD_EXAMPLES environment variable set to True
 DAG_ID = "example_bash_operator"
 
-# Enter a context with an instance of the API client
-with airflow_client.client.ApiClient(configuration) as api_client:
-    errors = False
 
-    print("[blue]Getting DAG list")
-    dag_api_instance = dag_api.DAGApi(api_client)
-    try:
-        api_response = dag_api_instance.get_dags()
-        print(api_response)
-    except airflow_client.client.OpenApiException as e:
-        print(f"[red]Exception when calling DagAPI->get_dags: {e}\n")
-        errors = True
-    else:
-        print("[green]Getting DAG list successful")
+# Enter a context with an instance of the API client

Review Comment:
   However there is one problem (small) with that. We are currently using `test_python_client.py` as an executable  script to run tests manually when verifying the client. 
   
   See https://github.com/apache/airflow/blob/main/dev/README_RELEASE_PYTHON_CLIENT.md#verify-the-release-candidate-by-contributors
   
   So we should either instruct the users to use `pytest` to run those tests, or turn it into runnable script (i.e. add 
   
   ```
   if __name__ == "__main__":
       test_python_client()
   ```
   
   I think the second option is best.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859675342


##########
.github/workflows/static-checks-mypy-docs.yml:
##########
@@ -96,6 +96,19 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to build docs (true/false)"

Review Comment:
   yep



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2503887101

   Cool!


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2496222810

   > ah it seems this one:
   > 
   > <img alt="image" width="1459" src="https://private-user-images.githubusercontent.com/31437079/389285779-a74a8b40-7e4f-4e51-86ac-0ecd6ccce3c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI0ODEzNzIsIm5iZiI6MTczMjQ4MTA3MiwicGF0aCI6Ii8zMTQzNzA3OS8zODkyODU3NzktYTc0YThiNDAtN2U0Zi00ZTUxLTg2YWMtMGVjZDZjY2NlM2MyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTI0VDIwNDQzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFmMjRkZGRlNWZhZGNhNTMzNDYyNGQ5NDkwOTc4ZGRjODdjZjcxYjdiZGUxMWM5MDA4MGNiMWY2NGY2OWE5MDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.iJsao7qUG9nAj89IobSGOAcxowqEVQvJv6NVLsPlz8E">
   
   This looks like github actions have hard limit. 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1855528838


##########
.github/workflows/ci.yml:
##########
@@ -505,6 +500,13 @@ jobs:
       upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
       include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
       debug-resources: ${{ needs.build-info.outputs.debug-resources }}
+      is-special-tests-require: ${{

Review Comment:
   Not sure if there is better way to handle this. openapi tests executes when `needs-api-codegen` is true and other special tests executes based on these conditions.
   ```
   needs.build-info.outputs.run-tests == 'true' &&
      (needs.build-info.outputs.canary-run == 'true' ||
           needs.build-info.outputs.upgrade-to-newer-dependencies != 'false' ||
           needs.build-info.outputs.full-tests-needed == 'true')
   ```
   
   To support both in special tests workflow, am sending the evaluated condition value. so inside special tests workflow we can do if check.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859371798


##########
dev/breeze/src/airflow_breeze/commands/testing_commands.py:
##########
@@ -1022,6 +1024,92 @@ def helm_tests(
     sys.exit(result.returncode)
 
 
+@group_for_testing.command(
+    name="openapi-tests",
+    help="Run open api tests.",
+    context_settings=dict(
+        ignore_unknown_options=True,
+        allow_extra_args=True,
+    ),
+)
+@option_install_airflow_python_client

Review Comment:
   I think there is no need to have those two flags here. I can't imagine running "openapi-tests" command and NOT having those two flags set - basically "openapi-tests" should always set those to True - and we can hard-code them.
   
   On the other hand, those options should be set as flags in "shell" command. The "shell" command is basically the same as `breeze` but it has way more flags/options and you can use it to enter breeze and emulating what other testing commands are doing without actually running the tests - which is very convenient if you want to iterate over tests in breeze.
   
   That should allow the user to do this:
   
   ```
   breeze shell --install-airflow-python-client --start-airflow-minimal-webserver-with-examples 
   ```
   
   And then run the test manually with pytest or as script and iterate on it.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859385450


##########
dev/breeze/doc/05_test_commands.rst:
##########
@@ -218,6 +218,29 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
   :alt: Breeze testing providers-integration-tests
 
 
+Running OpenAPI Client tests

Review Comment:
   Make sense..



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859389741


##########
dev/breeze/src/airflow_breeze/commands/testing_commands.py:
##########
@@ -1022,6 +1024,92 @@ def helm_tests(
     sys.exit(result.returncode)
 
 
+@group_for_testing.command(
+    name="openapi-tests",
+    help="Run open api tests.",
+    context_settings=dict(
+        ignore_unknown_options=True,
+        allow_extra_args=True,
+    ),
+)
+@option_install_airflow_python_client

Review Comment:
   Also LIKELY the `--start-airflow-minimal-webserver-with-examples` is a BIT too descriptive. Maybe `--start-webserver-with-examples`  would be a bit better ?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859358645


##########
scripts/in_container/check_connectivity.sh:
##########
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash

Review Comment:
   :heart: this one to be searated :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2496293050

   Alright one test failing but, its not related to this i believe. i will check that separate..


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2498835233

   > > Full tests not triggering , might be because of changes to workflows? @potiuk does this change need to come from the apache repo?
   > 
   > This is fixed after removing openapi tests workflow :)
   
   You don't need to worry with running a couple of attempts - I think this is usual when trying to experiment/model/integrate in Github. If you are afraid, just set the PR to Draft :-D
   
   Otherwise... really looking forward having this test :+1: 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2496322563

   > Full tests not triggering , might be because of changes to workflows? @potiuk does this change need to come from the apache repo?
   
   This is fixed after removing openapi tests workflow :) 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1857444371


##########
scripts/docker/entrypoint_ci.sh:
##########
@@ -391,12 +394,61 @@ function check_force_lowest_dependencies() {
     set +x
 }
 
+function check_airflow_python_client_installation() {
+    if [[ ${INSTALL_AIRFLOW_PYTHON_CLIENT=} != "true" ]]; then
+        return
+    fi
+    python "${IN_CONTAINER_DIR}/install_airflow_python_client.py"
+}
+
+function start_airflow_minimal_webserver_with_examples(){
+    if [[ ${START_AIRFLOW_MINIMAL_WEBSERVER_WITH_EXAMPLES=} != "true" ]]; then
+        return
+    fi
+    export AIRFLOW__CORE__LOAD_EXAMPLES=True
+    export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.session,airflow.providers.fab.auth_manager.api.auth.backend.basic_auth
+    export AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
+    echo
+    echo "${COLOR_BLUE}Initializing database${COLOR_RESET}"
+    echo
+    airflow db migrate
+    echo
+    echo "${COLOR_BLUE}Database initialized${COLOR_RESET}"
+    echo
+    echo "${COLOR_BLUE}Parsing example dags${COLOR_RESET}"
+    echo
+    airflow scheduler --num-runs 100
+    echo "Example dags parsing finished"
+    echo "Create admin user"
+    airflow users create -u admin -p admin -f Thor -l Administrator -r Admin -e admin@email.domain
+    echo "Admin user created"
+    echo
+    echo "${COLOR_BLUE}Starting airflow webserver${COLOR_RESET}"
+    echo
+    airflow webserver --port 8080 --daemon
+    echo
+    echo "${COLOR_BLUE}Waiting for webserver to start${COLOR_RESET}"
+    echo
+    check_service_connection "Airflow webserver" "run_nc localhost 8080" 50

Review Comment:
   using function from this  `scripts/in_container/check_connectivity.sh`



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #44326:
URL: https://github.com/apache/airflow/pull/44326#issuecomment-2502165929

   BTW. I really like how this `tests openapi-tests` (or whatever we name it eventually) is running all the tests of the client as well that gets generated :)


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859538896


##########
.github/workflows/static-checks-mypy-docs.yml:
##########
@@ -96,6 +96,19 @@ on:  # yamllint disable-line rule:truthy
         description: "Whether to build docs (true/false)"

Review Comment:
   Should i change this file name ? `ci-image-checks.yml` ?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1857450396


##########
Dockerfile.ci:
##########
@@ -1155,12 +1155,48 @@ function check_force_lowest_dependencies() {
     set +x
 }
 
+function check_airflow_python_client_installation() {
+    if [[ ${INSTALL_AIRFLOW_PYTHON_CLIENT=} != "true" ]]; then
+        return
+    fi
+    python "${IN_CONTAINER_DIR}/install_airflow_python_client.py"
+}
+
+function start_airflow_minimal_webserver_with_examples(){
+    if [[ ${START_AIRFLOW_MINIMAL_WEBSERVER_WITH_EXAMPLES=} != "true" ]]; then
+        return
+    fi
+    export AIRFLOW__CORE__LOAD_EXAMPLES=True
+    export AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.session,airflow.providers.fab.auth_manager.api.auth.backend.basic_auth
+    export AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
+    echo
+    echo "${COLOR_BLUE}Initializing database${COLOR_RESET}"
+    echo
+    airflow db migrate
+    echo
+    echo "${COLOR_BLUE}Database initialized${COLOR_RESET}"
+    echo
+    echo "${COLOR_BLUE}Parsing example dags${COLOR_RESET}"
+    echo
+    airflow scheduler --num-runs 100
+    echo "Example dags parsing finished"
+    echo "Create admin user"
+    airflow users create -u admin -p admin -f Thor -l Administrator -r Admin -e admin@email.domain
+    echo "Admin user created"
+    echo
+    echo "${COLOR_BLUE}Starting airflow webserver${COLOR_RESET}"
+    echo
+    airflow webserver --port 8080 --daemon && sleep 60

Review Comment:
   Yes agree, thanks for pointing that. now i have modified. might be these steps `scripts/docker/entrypoint_ci.sh:332`( internal api check) also can be refactored with the latest modification, have moved some connectivity check functions to `scripts/in_container/check_connectivity.sh` WDYT?
   
   If you agree i can update internal api check in this pr or can also do it in separate pr after we merge this :) 



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859347754


##########
clients/python/test_python_client.py:
##########
@@ -63,68 +65,77 @@
 # or AIRFLOW__CORE__LOAD_EXAMPLES environment variable set to True
 DAG_ID = "example_bash_operator"
 
-# Enter a context with an instance of the API client
-with airflow_client.client.ApiClient(configuration) as api_client:
-    errors = False
 
-    print("[blue]Getting DAG list")
-    dag_api_instance = dag_api.DAGApi(api_client)
-    try:
-        api_response = dag_api_instance.get_dags()
-        print(api_response)
-    except airflow_client.client.OpenApiException as e:
-        print(f"[red]Exception when calling DagAPI->get_dags: {e}\n")
-        errors = True
-    else:
-        print("[green]Getting DAG list successful")
+# Enter a context with an instance of the API client

Review Comment:
   However there is one problem (small) with that. We are currently using `test_python_client.py` as an executable  script to run tests manually when verifying the client. 
   
   See https://github.com/apache/airflow/blob/main/dev/README_RELEASE_PYTHON_CLIENT.md#verify-the-release-candidate-by-contributors
   
   So we should either instruct the users to use `pytest` to run those tests, or turn it into runnable script (i.e. add 
   
   ```python
   if __name__ == "__main__":
       test_python_client()
   ```
   
   I think the second option is best.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Move OpenAPI tests to breeze container [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859352939


##########
dev/breeze/src/airflow_breeze/utils/run_tests.py:
##########
@@ -40,6 +40,18 @@
 
 DOCKER_TESTS_ROOT = AIRFLOW_SOURCES_ROOT / "docker_tests"
 DOCKER_TESTS_REQUIREMENTS = DOCKER_TESTS_ROOT / "requirements.txt"
+OPEN_API_TESTS_ROOT = AIRFLOW_SOURCES_ROOT / "clients/python"
+
+IGNORE_DB_INIT_FOR_TEST_GROUPS = [

Review Comment:
   Nice!



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org