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

Return stacktrace from the DAG file in test_should_not_do_database_queries #39331

Merged
merged 1 commit into from Apr 30, 2024

Conversation

Taragolis
Copy link
Contributor

Right now stacktrace is hardcoded to the 5, this one give to ability redefine default values, as well as filter it starting from the specific value

This one should help to show exact line when this test do not pass, see: #39245 (comment)

Before changes

root@5eaf79ab9e33:/opt/airflow#  pytest "tests/always/test_example_dags.py::test_should_not_do_database_queries[tests/system/providers/amazon/aws/example_bedrock_knowledge_base.py]"

...
FAILED tests/always/test_example_dags.py::test_should_not_do_database_queries[tests/system/providers/amazon/aws/example_bedrock_knowledge_base.py] - AssertionError: The expected number of db queries is 0 with extra margin: 0. The current number is 2.

Recorded query locations:
	base_aws.py:conn_config:580>base.py:get_connection:83>connection.py:get_connection_from_secrets:509>metastore.py:get_connection:43>metastore.py:_fetch_connection:74:	2

After changes

root@5eaf79ab9e33:/opt/airflow#  pytest "tests/always/test_example_dags.py::test_should_not_do_database_queries[tests/system/providers/amazon/aws/example_bedrock_knowledge_base.py]"

...
FAILED tests/always/test_example_dags.py::test_should_not_do_database_queries[tests/system/providers/amazon/aws/example_bedrock_knowledge_base.py] - AssertionError: The expected number of db queries is 0 with extra margin: 0. The current number is 2.

Recorded query locations:
	example_bedrock_knowledge_base.py:<module>:392 > functools.py:__get__:967 > base_aws.py:conn:719 > base_aws.py:region_name:621 > functools.py:__get__:967 > base_aws.py:conn_config:580 > base.py:get_connection:83 > connection.py:get_connection_from_secrets:509 > metastore.py:get_connection:43 > metastore.py:_fetch_connection:74:	1
	example_bedrock_knowledge_base.py:<module>:393 > functools.py:__get__:967 > base_aws.py:conn:719 > base_aws.py:region_name:621 > functools.py:__get__:967 > base_aws.py:conn_config:580 > base.py:get_connection:83 > connection.py:get_connection_from_secrets:509 > metastore.py:get_connection:43 > metastore.py:_fetch_connection:74:	1

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
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.

@Taragolis Taragolis added changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge labels Apr 30, 2024
@Taragolis Taragolis closed this Apr 30, 2024
@Taragolis Taragolis reopened this Apr 30, 2024
@Taragolis Taragolis merged commit 3204d64 into apache:main Apr 30, 2024
68 of 69 checks passed
@Taragolis Taragolis deleted the filter-trace-from-module branch April 30, 2024 18:30
@ferruzzi
Copy link
Contributor

ferruzzi commented May 1, 2024

Sorry I missed this one, thanks for that.

RodrigoGanancia pushed a commit to RodrigoGanancia/airflow that referenced this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants