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

Remove debug mode for pytest config #27157

Merged
merged 6 commits into from Jun 8, 2023

Conversation

lazebnyi
Copy link
Collaborator

@lazebnyi lazebnyi commented Jun 8, 2023

What:

This pull request suggests removing the debug mode from the pyproject.toml configuration file for tests. Developers can manually adjust the log level when they need to debug a test.

How:

  • Removed the debug log level from the pyproject.toml configuration file for tests.
  • Force log level for smart open to ERROR

Justification:

When working with source files, we utilize the open() method from the smart open library to open files - here. However, this method also logs local variables before opening the file - here and here. Simultaneously, we employ the pyproject.toml configuration file with the debug log level enabled to execute our unit/coverage/integration tests - here. As a result, all the arguments passed to the open() method will be displayed in the output.

Related Issues:

Fixes #27128

Checklist:

  • Removed debug mode from pyproject.toml for tests
  • Ran unit tests to ensure there are no regressions

@lazebnyi lazebnyi changed the title Deleted pytest log level Remove debug mode for pytests config Jun 8, 2023
@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Jun 8, 2023

/test connector=connectors/source-file

🕑 connectors/source-file https://github.com/airbytehq/airbyte/actions/runs/5212650269
✅ connectors/source-file https://github.com/airbytehq/airbyte/actions/runs/5212650269
Python tests coverage:

Name                      Stmts   Miss  Cover
---------------------------------------------
source_file/__init__.py       2      0   100%
source_file/utils.py         13      1    92%
source_file/source.py        83      7    92%
source_file/client.py       335     56    83%
---------------------------------------------
TOTAL                       433     64    85%
Name                      Stmts   Miss  Cover
---------------------------------------------
source_file/__init__.py       2      0   100%
source_file/client.py       335     56    83%
source_file/utils.py         13      8    38%
source_file/source.py        83     62    25%
---------------------------------------------
TOTAL                       433    126    71%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: Incremental syncs are not supported on this connector.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:598: The previous and actual discovered catalogs are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
======================== 35 passed, 4 skipped in 52.65s ========================

@lazebnyi lazebnyi changed the title Remove debug mode for pytests config Remove debug mode for pytest config Jun 8, 2023
@alafanechere
Copy link
Contributor

Can we also force the log level of the smart-open logger and set it to error? I'm affraid that this problem can occur again on source-file if a context different than test also enables the debug log level?

@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Jun 8, 2023

Can we also force the log level of the smart-open logger and set it to error? I'm affraid that this problem can occur again on source-file if a context different than test also enables the debug log level?

Done.

@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Jun 8, 2023

/test connector=connectors/source-file

🕑 connectors/source-file https://github.com/airbytehq/airbyte/actions/runs/5213350606
✅ connectors/source-file https://github.com/airbytehq/airbyte/actions/runs/5213350606
Python tests coverage:

Name                      Stmts   Miss  Cover
---------------------------------------------
source_file/__init__.py       2      0   100%
source_file/utils.py         13      1    92%
source_file/source.py        83      7    92%
source_file/client.py       337     56    83%
---------------------------------------------
TOTAL                       435     64    85%
Name                      Stmts   Miss  Cover
---------------------------------------------
source_file/__init__.py       2      0   100%
source_file/client.py       337     56    83%
source_file/utils.py         13      8    38%
source_file/source.py        83     62    25%
---------------------------------------------
TOTAL                       435    126    71%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/plugin.py:63: Skipping TestIncremental.test_two_sequential_reads: Incremental syncs are not supported on this connector.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:598: The previous and actual discovered catalogs are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
======================== 35 passed, 4 skipped in 53.72s ========================

@octavia-squidington-iii octavia-squidington-iii added area/documentation Improvements or additions to documentation connectors/source/file-secure labels Jun 8, 2023
@lazebnyi lazebnyi self-assigned this Jun 8, 2023
@lazebnyi lazebnyi merged commit 0bdd844 into master Jun 8, 2023
22 of 26 checks passed
@lazebnyi lazebnyi deleted the lazebnyi/delete-debug-mode-for-pytest branch June 8, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/file connectors/source/file-secure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

source-file: abusive debug log outputs
4 participants