Skip to content

Commit 5ae6850

Browse files
committed
chore: test private ip with logging
1 parent 72369dc commit 5ae6850

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.cl/cloudbuild.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@
1313
# limitations under the License.
1414

1515
steps:
16-
- id: run unit tests
17-
name: python:3.10
16+
- id: run integration tests
17+
name: python:3.13
1818
entrypoint: bash
19+
env:
20+
- "IP_TYPE=private"
21+
secretEnv: ["MYSQL_CONNECTION_NAME", "MYSQL_USER", "MYSQL_IAM_USER", "MYSQL_PASS", "MYSQL_DB", "POSTGRES_CONNECTION_NAME", "POSTGRES_USER", "POSTGRES_IAM_USER", "POSTGRES_PASS", "POSTGRES_DB", "POSTGRES_CAS_CONNECTION_NAME", "POSTGRES_CAS_PASS", "POSTGRES_CUSTOMER_CAS_CONNECTION_NAME", "POSTGRES_CUSTOMER_CAS_PASS", "POSTGRES_CUSTOMER_CAS_PASS_VALID_DOMAIN_NAME","SQLSERVER_CONNECTION_NAME", "SQLSERVER_USER", "SQLSERVER_PASS", "SQLSERVER_DB"]
1922
args:
2023
- "-c"
2124
- |
2225
pip install nox
23-
nox -s unit-3.10
26+
nox -s system-3.13
2427
- id: run integration tests
25-
name: python:3.10
28+
name: python:3.9
2629
entrypoint: bash
2730
env:
2831
- "IP_TYPE=private"
@@ -31,7 +34,7 @@ steps:
3134
- "-c"
3235
- |
3336
pip install nox
34-
nox -s system-3.10
37+
nox -s system-3.9
3538
availableSecrets:
3639
secretManager:
3740
- versionName: 'projects/$PROJECT_ID/secrets/MYSQL_CONNECTION_NAME/versions/latest'

tests/system/test_asyncpg_connection.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ async def getconn(
147147
user=user,
148148
password=password,
149149
db=db,
150-
ip_type=os.environ.get(
151-
"IP_TYPE", "public"
152-
), # can also be "private" or "psc",
150+
ip_type="private", # can also be "private" or "psc",
153151
**kwargs,
154152
)
155153
return conn

tests/system/test_asyncpg_iam_auth.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import sqlalchemy
2121
import sqlalchemy.ext.asyncio
22+
import logging
2223

2324
from google.cloud.sql.connector import Connector
2425

@@ -109,3 +110,7 @@ async def test_lazy_iam_authn_connection_with_asyncpg() -> None:
109110
assert res[0] == 1
110111

111112
await connector.close_async()
113+
114+
logging.basicConfig(format="%(asctime)s [%(levelname)s]: %(message)s")
115+
logger = logging.getLogger(name="google.cloud.sql.connector")
116+
logger.setLevel(logging.DEBUG)

0 commit comments

Comments
 (0)