Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add INT live test #19902

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.azure.core.util.CoreUtils;
import com.azure.identity.DefaultAzureCredentialBuilder;
import reactor.core.publisher.Mono;
import com.azure.identity.ClientSecretCredentialBuilder;

import java.time.OffsetDateTime;
import java.util.ArrayList;
Expand Down Expand Up @@ -73,7 +74,14 @@ protected CommunicationIdentityClientBuilder createClientBuilderUsingManagedIden
if (getTestMode() == TestMode.PLAYBACK) {
builder.credential(new FakeCredentials());
} else {
builder.credential(new DefaultAzureCredentialBuilder().build());
Configuration configuration = Configuration.getGlobalConfiguration().clone();
String clientId = configuration.get("COMMUNICATION_CLIENT_ID"); //Configuration.PROPERTY_AZURE_CLIENT_ID);
String tenantId = configuration.get("COMMUNICATION_TENANT_ID");//"COMMUNICATION_TENANT_ID");// Configuration.PROPERTY_AZURE_TENANT_ID);
String clientSecret = configuration.get("COMMUNICATION_CLIENT_SECRET"); //Configuration.PROPERTY_AZURE_CLIENT_SECRET);

//builder.credential(new DefaultAzureCredentialBuilder().build());
builder.credential(new ClientSecretCredentialBuilder().tenantId(tenantId).clientId(clientId).clientSecret(clientSecret).build());
//builder.credential(new DefaultAzureCredentialBuilder().build());
}

if (getTestMode() == TestMode.RECORD) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.azure.core.util.Configuration;
import com.azure.core.util.CoreUtils;
import com.azure.identity.DefaultAzureCredentialBuilder;

import com.azure.identity.ClientSecretCredentialBuilder;
import reactor.core.publisher.Mono;

public class PhoneNumbersIntegrationTestBase extends TestBase {
Expand Down Expand Up @@ -97,7 +97,15 @@ protected PhoneNumbersClientBuilder getClientBuilderUsingManagedIdentity(HttpCli
if (getTestMode() == TestMode.PLAYBACK) {
builder.credential(new FakeCredentials());
} else {
builder.credential(new DefaultAzureCredentialBuilder().build());
Configuration configuration = Configuration.getGlobalConfiguration().clone();
String clientId = configuration.get("COMMUNICATION_CLIENT_ID"); //Configuration.PROPERTY_AZURE_CLIENT_ID);
String tenantId = configuration.get("COMMUNICATION_TENANT_ID");//"COMMUNICATION_TENANT_ID");// Configuration.PROPERTY_AZURE_TENANT_ID);
String clientSecret = configuration.get("COMMUNICATION_CLIENT_SECRET"); //Configuration.PROPERTY_AZURE_CLIENT_SECRET);

//builder.credential(new DefaultAzureCredentialBuilder().build());
builder.credential(new ClientSecretCredentialBuilder().tenantId(tenantId).clientId(clientId).clientSecret(clientSecret).build());

//builder.credential(new DefaultAzureCredentialBuilder().build());
}

if (getTestMode() == TestMode.RECORD) {
Expand Down
6 changes: 5 additions & 1 deletion sdk/communication/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"defaultValue": "communication",
"type": "string"
},
"communicationServicesEndpointSuffix": {
"defaultValue": ".communication.azure.com",
"type": "string"
},
"testApplicationOid": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -52,7 +56,7 @@
},
"COMMUNICATION_SERVICE_ENDPOINT": {
"type": "string",
"value": "[concat('https://', parameters('baseName'), '-', parameters('endpointPrefix'), '.communication.azure.com')]"
"value": "[concat('https://', parameters('baseName'), '-', parameters('endpointPrefix'), parameters('communicationServicesEndpointSuffix'))]"
},
"COMMUNICATION_SERVICE_ACCESS_KEY": {
"type": "string",
Expand Down
10 changes: 6 additions & 4 deletions sdk/communication/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ trigger: none
stages:
- template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
CloudConfig:
Public:
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
Int:
SubscriptionConfiguration: $(sub-config-communication-int-test-resources)
Clouds: Public,Int
Artifacts:
- name: azure-communication-chat
groupId: com.azure
Expand Down Expand Up @@ -46,10 +52,6 @@ stages:
SKIP_PHONENUMBER_INTEGRATION_TESTS: TRUE
SKIP_LIVE_TEST: TRUE
AZURE_SUBSCRIPTION_ID: $(acs-subscription-id)
COMMUNICATION_LIVETEST_CONNECTION_STRING: $(communication-livetest-connection-string)
SMS_SERVICE_PHONE_NUMBER: $(communication-livetest-phone-number)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
COMMUNICATION_PHONE_NUMBER: $(communication-livetest-phone-number-for-config)