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

test: update tests to be more scalable #1156

Merged
merged 8 commits into from
Sep 5, 2024
Merged

Conversation

jackwotherspoon
Copy link
Collaborator

@jackwotherspoon jackwotherspoon commented Sep 4, 2024

Current integration tests use a bad practice of initializing the Connector
within the getconn creator func. This creates a Connector on each
database conn instead of re-using a single connector:

def getconn() -> pg8000.dbapi.Connection:
    # initialize Connector object for connections to Cloud SQL
    with Connector() as connector:

This PR also makes a single test file be able to have tests connect to
different Cloud SQL instances (wanted for CAS tests) by removing
the pytest fixture in place of helper func.

@jackwotherspoon jackwotherspoon self-assigned this Sep 4, 2024
@jackwotherspoon jackwotherspoon marked this pull request as ready for review September 4, 2024 21:25
@jackwotherspoon jackwotherspoon requested a review from a team as a code owner September 4, 2024 21:25
@jackwotherspoon jackwotherspoon changed the title tests: update tests to be more scalable test: update tests to be more scalable Sep 4, 2024
Copy link
Member

@enocom enocom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: Thanks for cleaning these up.

@jackwotherspoon jackwotherspoon merged commit 610209d into main Sep 5, 2024
15 checks passed
@jackwotherspoon jackwotherspoon deleted the update-samples branch September 5, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants