Skip to content

Commit 1d36f4d

Browse files
test: add explicit credentials and project to test (googleapis#1372)
* test: add explicit credentials and project to test Tests need to be able to run in environments without any default credentials. This requires the test to explictly set the credentials and the project that should be used. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 064d9dc commit 1d36f4d

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.kokoro/presubmit/presubmit.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Format: //devtools/kokoro/config/proto/build.proto
22

3-
# Only run a subset of all nox sessions
3+
# Disable system tests.
44
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "unit-3.8 unit-3.12 cover docs docfx"
5+
key: "RUN_SYSTEM_TESTS"
6+
value: "false"
77
}

tests/unit/spanner_dbapi/test_connection.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,14 @@ def test_custom_database_role(self):
830830
from google.cloud.spanner_dbapi import connect
831831

832832
role = "some_role"
833-
connection = connect("test-instance", "test-database", database_role=role)
833+
connection = connect(
834+
"test-instance",
835+
"test-database",
836+
project="test-project",
837+
database_role=role,
838+
credentials=AnonymousCredentials(),
839+
client_options={"api_endpoint": "none"},
840+
)
834841
self.assertEqual(connection.database.database_role, role)
835842

836843
def test_invalid_custom_client_connection(self):

0 commit comments

Comments
 (0)