Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Code Coverage for Airflow #35127

Open
ephraimbuddy opened this issue Oct 23, 2023 · 1 comment
Open

Improve Code Coverage for Airflow #35127

ephraimbuddy opened this issue Oct 23, 2023 · 1 comment
Labels

Comments

@ephraimbuddy
Copy link
Contributor

ephraimbuddy commented Oct 23, 2023

Description

Airflow code coverage is currently at an impressive 84% but we would like to improve the code coverage and get to at least 95%.
This is a call to help improve the code coverage by adding the missing tests.

You can use the code coverage tool to find modules to improve. Here is the link to the documentation: https://github.com/apache/airflow/blob/main/contributing-docs/testing/unit_tests.rst#code-coverage

Below is how you can discover modules to work on, follow the above link for up-to-date instruction:

  • Initiate a breeze shell.
  • Execute one of the commands below based on the desired coverage area:
    Core: python scripts/cov/core_coverage.py
    REST API: python scripts/cov/restapi_coverage.py
    CLI: python scripts/cov/cli_coverage.py
    Webserver: python scripts/cov/www_coverage.py
    After execution, the coverage report will be available at: http://localhost:28000/dev/coverage/index.html.
  • Choose any of the modules and improve it

Note
In order to see the coverage report, you must start webserver first in breeze environment via airflow webserver. Once you enter breeze, you can start tmux (terminal multiplexer) and split the terminal (by pressing ctrl-B " for example) to continue testing and run the webserver in one terminal and run tests in the second one (you can switch between the terminals with ctrl-B <arrow>).

PRs should be per module or related codebase

UPDATE (added by @potiuk )

Also you might want to have a look at #35442 - we had a "project structure" test that was supposed to detect modules that do not have corresponding tests and fail our build in this case. This test has been however broken for a long time and we have many missing modules on the list.

ephraimbuddy added a commit to astronomer/airflow that referenced this issue Oct 24, 2023
This commit adds missing tests for the DAG endpoint to improve the coverage.

Related: apache#35127
potiuk pushed a commit that referenced this issue Oct 24, 2023
This commit adds missing tests for the DAG endpoint to improve the coverage.

Related: #35127
ephraimbuddy added a commit to astronomer/airflow that referenced this issue Oct 30, 2023
@potiuk
Copy link
Member

potiuk commented Nov 5, 2023

Hey @ephraimbuddy - I added a comment in the issue description.

Also you might want to have a look at #35442 - we had a "project structure" test that was supposed to detect modules that do not have corresponding tests and fail our build in this case. This test has been however broken for a long time and we have many missing modules on the list.

kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jul 18, 2024
This commit adds missing tests for the DAG endpoint to improve the coverage.

Related: apache/airflow#35127
GitOrigin-RevId: 9645786ad30529986447661ca7357398559fd3fa
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 20, 2024
This commit adds missing tests for the DAG endpoint to improve the coverage.

Related: apache/airflow#35127
GitOrigin-RevId: 9645786ad30529986447661ca7357398559fd3fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants