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

[Communication] Add variables necessary for using new azure subscription for SMS live tests #15213

Merged
merged 5 commits into from
Nov 14, 2020
Merged
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 @@ -15,9 +15,6 @@
ResponseReplacerProcessor
)

SKIP_PHONE_NUMBER_TESTS = True
PHONE_NUMBER_TEST_SKIP_REASON= "Phone Number infra for live tests not ready yet"

class SMSClientTest(CommunicationTestCase):
def __init__(self, method_name):
super(SMSClientTest, self).__init__(method_name)
Expand All @@ -28,7 +25,7 @@ def setUp(self):
if self.is_playback():
self.phone_number = "+18000005555"
else:
self.phone_number = os.getenv("PHONE_NUMBER")
self.phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER")

self.recording_processors.extend([
BodyReplacerProcessor(keys=["to", "from", "messageId"]),
Expand All @@ -37,7 +34,6 @@ def setUp(self):
self.sms_client = SmsClient.from_connection_string(self.connection_str)

@pytest.mark.live_test_only
@pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON)
def test_send_sms(self):

# calling send() with sms values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
BodyReplacerProcessor, ResponseReplacerProcessor
)

SKIP_PHONE_NUMBER_TESTS = True
PHONE_NUMBER_TEST_SKIP_REASON= "Phone Number infra for live tests not ready yet"

class SMSClientTestAsync(AsyncCommunicationTestCase):
def __init__(self, method_name):
super(SMSClientTestAsync, self).__init__(method_name)
Expand All @@ -36,7 +33,6 @@ def setUp(self):

@AsyncCommunicationTestCase.await_prepared_test
@pytest.mark.live_test_only
@pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON)
async def test_send_sms_async(self):

sms_client = SmsClient.from_connection_string(self.connection_str)
Expand Down
6 changes: 3 additions & 3 deletions sdk/communication/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
EnvVars:
AZURE_TEST_RUN_LIVE: 'true'
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_SUBSCRIPTION_ID: $(acs-subscription-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING: $(python-communication-connection-string)
AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER: $(python-communication-phone-number)
AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING: $(communication-livetest-connection-string)
AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER: $(communication-livetest-phone-number)