Skip to content

chore: add tests for sync methods in async interfaces #61

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

Merged
merged 4 commits into from
Jan 31, 2025
Merged

Conversation

vishwarajanand
Copy link
Collaborator

@vishwarajanand vishwarajanand commented Jan 30, 2025

In an unrelated PR #57, test coverage dropped to <90, so adding some tests to bump it up.

Also contains, nits (improper spacing) on exception messages for sync methods of async interfaces.

@product-auto-label product-auto-label bot added the api: cloudsql-postgres Issues related to the googleapis/llama-index-cloud-sql-pg-python API. label Jan 30, 2025
@vishwarajanand vishwarajanand marked this pull request as ready for review January 30, 2025 13:54
@vishwarajanand vishwarajanand requested review from a team as code owners January 30, 2025 13:54
@averikitsch
Copy link
Collaborator

In an unrelated PR #57, test coverage dropped to <90, so adding some tests to bump it up.

Also contains, nits (improper spacing) on exception messages for sync methods of async interfaces.

Why did the test pass? Is our codecoverage setup different than langchain that errors out?

@vishwarajanand
Copy link
Collaborator Author

@averikitsch the tests indeed passed now despite having coverage<90. Example, recent cloud build is green when the logs suggested:

FAIL Required test coverage of 90.0% not reached. Total coverage: 89.89%

My hypothesis is that this happens due to rounding issue with pytest, (89.89 ==> 90). I made a github PR to assert that our code coverage configs are indeed correct and tests fail if coverage drops below the 89% mark, and they do fail when coverage is 88.76%.

Ref: #63

@vishwarajanand
Copy link
Collaborator Author

vishwarajanand commented Jan 31, 2025

Probably the default value (zero) of precision in pytest-cov plugin is to blame and a solution could be to set precision in addition to fail_under in the .coveragerc file.

But its an overkill for just 1% coverage.

@averikitsch
Copy link
Collaborator

Thank you!

@averikitsch averikitsch merged commit 36fe828 into main Jan 31, 2025
8 checks passed
@averikitsch averikitsch deleted the test_fix branch January 31, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: cloudsql-postgres Issues related to the googleapis/llama-index-cloud-sql-pg-python API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants