Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ jobs:
with:
secrets: |-
MYSQL_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_CONNECTION_NAME
MYSQL_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_IAM_CONNECTION_NAME
MYSQL_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER
MYSQL_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_PYTHON
MYSQL_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_PASS
MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB
POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME
POSTGRES_IAM_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_IAM_CONNECTION_NAME
POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER
POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_PYTHON
POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS
Expand All @@ -91,13 +89,11 @@ jobs:
- name: Run tests
env:
MYSQL_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_CONNECTION_NAME }}"
MYSQL_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_IAM_CONNECTION_NAME }}"
MYSQL_USER: "${{ steps.secrets.outputs.MYSQL_USER }}"
MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER }}"
MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}"
MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}"
POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}"
POSTGRES_IAM_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_IAM_CONNECTION_NAME }}"
POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}"
POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}"
POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}"
Expand Down
8 changes: 2 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,19 @@ To run all integration tests against real Cloud SQL instances
1. Once created, set the following environment variables:

```sh
# MySQL instance with IAM authentication enabled
export MYSQL_CONNECTION_NAME="<PROJECT>:<REGION>:<INSTANCE>"
export MYSQL_USER="db_user"
export MYSQL_PASS="db_pass"
export MYSQL_DB="db_name"
# MySQL instance with IAM authentication enabled
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we move the # MySQL instance with IAM authentication enabled comment above

export MYSQL_CONNECTION_NAME="<PROJECT>:<REGION>:<INSTANCE>"

Same with Postgres below...

# (can be same as MYSQL_CONNECTION_NAME)
export MYSQL_IAM_CONNECTION_NAME="<PROJECT>:<REGION>:<INSTANCE>"
# IAM Principal of ADC sourced credentials (truncated)
export MYSQL_IAM_USER="test-user@gmail.com"

# Postgres instance with IAM authentication enabled
export POSTGRES_CONNECTION_NAME="<PROJECT>:<REGION>:<INSTANCE>"
export POSTGRES_USER="db_user"
export POSTGRES_PASS="db_pass"
export POSTGRES_DB="db_name"
# Postgres instance with IAM authentication enabled
# (can be same as POSTGRES_CONNECTION_NAME)
export POSTGRES_IAM_CONNECTION_NAME="<PROJECT>:<REGION>:<INSTANCE>"
# IAM Principal of ADC sourced credentials
export POSTGRES_IAM_USER="test-user@gmail.com"

Expand Down
4 changes: 2 additions & 2 deletions tests/system/test_asyncpg_iam_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def getconn() -> asyncpg.Connection:

async def test_iam_authn_connection_with_asyncpg() -> None:
"""Basic test to get time from database."""
inst_conn_name = os.environ["POSTGRES_IAM_CONNECTION_NAME"]
inst_conn_name = os.environ["POSTGRES_CONNECTION_NAME"]
user = os.environ["POSTGRES_IAM_USER"]
db = os.environ["POSTGRES_DB"]

Expand All @@ -101,7 +101,7 @@ async def test_iam_authn_connection_with_asyncpg() -> None:

async def test_lazy_iam_authn_connection_with_asyncpg() -> None:
"""Basic test to get time from database."""
inst_conn_name = os.environ["POSTGRES_IAM_CONNECTION_NAME"]
inst_conn_name = os.environ["POSTGRES_CONNECTION_NAME"]
user = os.environ["POSTGRES_IAM_USER"]
db = os.environ["POSTGRES_DB"]

Expand Down
4 changes: 2 additions & 2 deletions tests/system/test_pg8000_iam_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def getconn() -> pg8000.dbapi.Connection:

def test_pg8000_iam_authn_connection() -> None:
"""Basic test to get time from database."""
inst_conn_name = os.environ["POSTGRES_IAM_CONNECTION_NAME"]
inst_conn_name = os.environ["POSTGRES_CONNECTION_NAME"]
user = os.environ["POSTGRES_IAM_USER"]
db = os.environ["POSTGRES_DB"]

Expand All @@ -99,7 +99,7 @@ def test_pg8000_iam_authn_connection() -> None:

def test_lazy_pg8000_iam_authn_connection() -> None:
"""Basic test to get time from database."""
inst_conn_name = os.environ["POSTGRES_IAM_CONNECTION_NAME"]
inst_conn_name = os.environ["POSTGRES_CONNECTION_NAME"]
user = os.environ["POSTGRES_IAM_USER"]
db = os.environ["POSTGRES_DB"]

Expand Down
4 changes: 2 additions & 2 deletions tests/system/test_pymysql_iam_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def getconn() -> pymysql.Connection:

def test_pymysql_iam_authn_connection() -> None:
"""Basic test to get time from database."""
inst_conn_name = os.environ["MYSQL_IAM_CONNECTION_NAME"]
inst_conn_name = os.environ["MYSQL_CONNECTION_NAME"]
user = os.environ["MYSQL_IAM_USER"]
db = os.environ["MYSQL_DB"]

Expand All @@ -99,7 +99,7 @@ def test_pymysql_iam_authn_connection() -> None:

def test_lazy_pymysql_iam_authn_connection() -> None:
"""Basic test to get time from database."""
inst_conn_name = os.environ["MYSQL_IAM_CONNECTION_NAME"]
inst_conn_name = os.environ["MYSQL_CONNECTION_NAME"]
user = os.environ["MYSQL_IAM_USER"]
db = os.environ["MYSQL_DB"]

Expand Down
Loading