Skip to content

Commit 5724ea5

Browse files
authored
Renaming to standard static EV (Azure#15160)
* Renaming to standard static EV * update readme
1 parent 7d0cf6b commit 5724ea5

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

sdk/communication/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If the tests are successful, we can proceed to run the tests in LIVE mode.
2828

2929
### Live mode
3030

31-
Since in LIVE mode we are hitting an actual resource, we must set the appropriate environment variables to make sure the code tests against the resource we want. Set up an env variable called `AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING` for Phone Number and SMS packages and set it to the connection string of the resource you want to test against. For all other communication packages, set up an environment variable called `COMMUNICATION_CONNECTION_STRING` and set it to the connection string of the resource you want to test against.
31+
Since in LIVE mode we are hitting an actual resource, we must set the appropriate environment variables to make sure the code tests against the resource we want. Set up an env variable called `COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING` for Phone Number and SMS packages and set it to the connection string of the resource you want to test against. For all other communication packages, set up an environment variable called `COMMUNICATION_CONNECTION_STRING` and set it to the connection string of the resource you want to test against.
3232

3333
Depending on which package you are testing, it may need special environment variables to test succesfully. In each package, there is a `recordedClient.ts` file; In that file you will find `const replaceableVariables` with the names of the variables the package uses. Make sure to set these variables before running the tests themselves.
3434

sdk/communication/communication-phone-numbers/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = function(config) {
5858
// https://www.npmjs.com/package/karma-env-preprocessor
5959
envPreprocessor: [
6060
"TEST_MODE",
61-
"AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING",
61+
"COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING",
6262
"INCLUDE_PHONENUMBER_LIVE_TESTS",
6363
"AZURE_PHONE_NUMBER",
6464
"COMMUNICATION_ENDPOINT"

sdk/communication/communication-phone-numbers/test.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Used in test to retrieve these values from a Communication Services resource
22
# in the Azure Portal.
3-
AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<accessKey>"
3+
COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<accessKey>"
44

55
# Our tests assume that TEST_MODE is "playback" by default. You can
66
# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely.

sdk/communication/communication-phone-numbers/test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Azure resource that is used by the tests in this project is:
1111
To run the live tests, you will need to set the below environment variables:
1212

1313
- `TEST_MODE`: Should have `live` assigned if you want to run live without recording. Assign `record` to run live with recording.
14-
- `COMMUNICATION_CONNECTION_STRING`: The primary connection string of the Communication Services resource in your account.
14+
- `COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING`: The primary connection string of the Communication Services resource in your account.
1515

1616
[azure_sub]: https://azure.microsoft.com/free/
1717
[azure_portal]: https://portal.azure.com

sdk/communication/communication-phone-numbers/test/public/utils/recordedClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface RecordedClient<T> {
3333
}
3434

3535
const replaceableVariables: { [k: string]: string } = {
36-
AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana",
36+
COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana",
3737
INCLUDE_PHONENUMBER_LIVE_TESTS: "false",
3838
COMMUNICATION_ENDPOINT: "https://endpoint/",
3939
AZURE_CLIENT_ID: "SomeClientId",
@@ -58,7 +58,7 @@ export function createRecordedClient(context: Context): RecordedClient<PhoneNumb
5858

5959
// casting is a workaround to enable min-max testing
6060
return {
61-
client: new PhoneNumbersClient(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING, {
61+
client: new PhoneNumbersClient(env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING, {
6262
httpClient: createTestHttpClient()
6363
} as PhoneNumbersClientOptions),
6464
recorder
@@ -79,7 +79,7 @@ export function createRecordedClientWithToken(
7979
): RecordedClient<PhoneNumbersClient> | undefined {
8080
const recorder = record(context, environmentSetup);
8181
let credential: TokenCredential;
82-
const endpoint = parseConnectionString(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING)
82+
const endpoint = parseConnectionString(env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING)
8383
.endpoint;
8484
if (isPlaybackMode()) {
8585
credential = {

sdk/communication/communication-sms/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports = function(config) {
5757
// environment values MUST be exported or set with same console running "karma start"
5858
// https://www.npmjs.com/package/karma-env-preprocessor
5959
envPreprocessor: [
60-
"AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING",
60+
"COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING",
6161
"AZURE_PHONE_NUMBER",
6262
"TEST_MODE",
6363
"AZURE_CLIENT_ID",

sdk/communication/communication-sms/test.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<accessKey>"
1+
COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<accessKey>"
22

33
# Our tests assume that TEST_MODE is "playback" by default. You can
44
# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely.

sdk/communication/communication-sms/test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Azure resource that is used by the tests in this project is:
1111
To run the live tests, you will need to set the below environment variables:
1212

1313
- `TEST_MODE`: Should have `live` assigned if you want to run live without recording. Assign `record` to run live with recording.
14-
- `AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING`: The primary connection string of the Communication Services resource in your account.
14+
- `COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING`: The primary connection string of the Communication Services resource in your account.
1515
- `AZURE_PHONE_NUMBER`: an SMS enabled phone number associated with the Communication Services resource.
1616

1717
[azure_sub]: https://azure.microsoft.com/free/

sdk/communication/communication-sms/test/public/utils/recordedClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { SmsClient, SmsClientOptions } from "../../../src";
1515

1616
export const recorderConfiguration: RecorderEnvironmentSetup = {
1717
replaceableVariables: {
18-
AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana",
18+
COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana",
1919
AZURE_PHONE_NUMBER: "+14255550123",
2020
AZURE_CLIENT_ID: "SomeClientId",
2121
AZURE_CLIENT_SECRET: "SomeClientSecret",
@@ -61,13 +61,13 @@ function createCredential(): TokenCredential {
6161

6262
export function createSmsClient(): SmsClient {
6363
// workaround: casting because min testing has issues with httpClient newer versions having extra optional fields
64-
return new SmsClient(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING, {
64+
return new SmsClient(env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING, {
6565
httpClient: createTestHttpClient()
6666
} as SmsClientOptions);
6767
}
6868

6969
export function createSmsClientWithToken(): SmsClient {
70-
const { endpoint } = parseConnectionString(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING);
70+
const { endpoint } = parseConnectionString(env.COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING);
7171
const credential: TokenCredential = createCredential();
7272
// workaround: casting because min testing has issues with httpClient newer versions having extra optional fields
7373
return new SmsClient(endpoint, credential, {

0 commit comments

Comments
 (0)