Skip to content

Commit

Permalink
Update search to enable live testing in sovereign clouds for multiple…
Browse files Browse the repository at this point in the history
… services (#17443)

* update to enable live testing in sovereign clouds for search

* Update search to enable live testing in sovereign clouds for multiple services

* update test-resources.json

* update recordedClient.ts
  • Loading branch information
zzhxiaofeng authored Sep 10, 2021
1 parent 59838aa commit 45a3fd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ export const environmentSetup: RecorderEnvironmentSetup = {
};

export function createClients<IndexModel>(indexName: string): Clients<IndexModel> {
switch (testEnv.AZURE_AUTHORITY_HOST) {
case "https://login.microsoftonline.us":
process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(".windows.net", ".azure.us");
break;
case "https://login.chinacloudapi.cn":
process.env.ENDPOINT = process.env.ENDPOINT!.toString().replace(".windows.net", ".azure.cn");
break;
}

const credential = new AzureKeyCredential(testEnv.SEARCH_API_ADMIN_KEY);
const searchClient = new SearchClient<IndexModel>(testEnv.ENDPOINT, indexName, credential);
const indexClient = new SearchIndexClient(testEnv.ENDPOINT, credential);
Expand Down
1 change: 1 addition & 0 deletions sdk/search/search-documents/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ stages:
parameters:
PackageName: "@azure/search-documents"
ServiceDirectory: search
SupportedClouds: 'Public,UsGov,China'
4 changes: 2 additions & 2 deletions sdk/search/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
},
"searchSku": {
"type": "string",
"defaultValue": "free",
"defaultValue": "basic",
"metadata": {
"description": "SKU for search resource. The default is 'free'"
"description": "SKU for search resource. The default is 'basic'"
}
}
},
Expand Down

0 comments on commit 45a3fd3

Please sign in to comment.