Skip to content

Commit f1d929a

Browse files
committed
allow use of custom workspace client in initTestWorkspace
1 parent 1aced60 commit f1d929a

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

tests/Backend/Features/RealReadOnlyBranches/SnowflakeRealBranchesTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public function testBucketsVisibilityBetweenBranchWorkspaces(): void
108108
true,
109109
true,
110110
$devClient,
111+
$this->workspaceSapiClient->getBranchAwareClient($branchId),
111112
);
112113
$wsDevBackend = WorkspaceBackendFactory::createWorkspaceBackend($wsDev, true);
113114
/**

tests/Backend/Workspaces/ParallelWorkspacesTestCase.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,21 @@ protected function initTestWorkspace(
4444
array $options = [],
4545
bool $forceRecreate = false,
4646
bool $async = true,
47-
?Client $client = null
47+
?Client $client = null,
48+
?Client $workspaceClient = null
4849
): array {
4950
if ($backend) {
5051
$options['backend'] = $backend;
5152
}
5253
if ($client === null) {
5354
$client = $this->_client;
5455
}
56+
if ($workspaceClient === null) {
57+
$workspaceClient = $this->workspaceSapiClient;
58+
}
5559

5660
$oldWorkspaces = $this->listTestWorkspaces($client);
57-
$workspaces = new Workspaces($this->workspaceSapiClient);
61+
$workspaces = new Workspaces($workspaceClient);
5862

5963
$oldWorkspace = $oldWorkspaces ? reset($oldWorkspaces) : null;
6064
if (!$oldWorkspace) {
@@ -64,7 +68,7 @@ protected function initTestWorkspace(
6468
|| $oldWorkspace['connection']['backend'] === $options['backend'];
6569
if (!$forceRecreate && $couldReuseExistingWorkspace) {
6670
$result = $workspaces->resetWorkspacePassword($oldWorkspace['id']);
67-
if ($this->getDefaultBackend($this->workspaceSapiClient) === self::BACKEND_BIGQUERY) {
71+
if ($this->getDefaultBackend($workspaceClient) === self::BACKEND_BIGQUERY) {
6872
$oldWorkspace['connection']['credentials'] = $result['credentials'];
6973
} else {
7074
$oldWorkspace['connection']['password'] = $result['password'];

0 commit comments

Comments
 (0)