Skip to content

Commit 59eb002

Browse files
test: add explicit credentials and project to test (#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 a8fccf2 commit 59eb002

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

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
}

packages/google-cloud-spanner/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)