Skip to content

Commit 032e58f

Browse files
Skip update capabilities live test (Azure#22911)
This prevents the update capabilities test from running in the live test pipeline, which caused an issue with parallel test execution updating the same phone number.
1 parent 3e9716b commit 032e58f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
SKIP_INT_PHONE_NUMBER_TESTS = os.getenv("COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", "false") == "true"
2323
INT_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers setting SMS capability does not support in INT. Skip these tests in INT."
2424

25+
SKIP_UPDATE_CAPABILITIES_TESTS = os.getenv("COMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST", "false") == "true"
26+
SKIP_UPDATE_CAPABILITIES_TESTS_REASON = "Phone number capabilities update does not currently support parallel execution. Skip these tests from live test pipeline."
27+
2528
class PhoneNumbersClientTest(CommunicationTestCase):
2629
def setUp(self):
2730
super(PhoneNumbersClientTest, self).setUp()
@@ -110,6 +113,7 @@ def test_search_available_phone_numbers(self):
110113
assert poller.result()
111114

112115
@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
116+
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
113117
def test_update_phone_number_capabilities_from_managed_identity(self):
114118
endpoint, access_key = parse_connection_str(self.connection_str)
115119
credential = create_token_credential()
@@ -131,6 +135,7 @@ def test_update_phone_number_capabilities_from_managed_identity(self):
131135
assert poller.status() == PhoneNumberOperationStatus.SUCCEEDED.value
132136

133137
@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
138+
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
134139
def test_update_phone_number_capabilities(self):
135140
current_phone_number = self.phone_number_client.get_purchased_phone_number(self.phone_number)
136141
calling_capabilities = PhoneNumberCapabilityType.INBOUND if current_phone_number.capabilities.calling == PhoneNumberCapabilityType.OUTBOUND else PhoneNumberCapabilityType.OUTBOUND

sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
SKIP_INT_PHONE_NUMBER_TESTS = os.getenv("COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST", "false") == "true"
2424
INT_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers setting SMS capability does not support in INT. Skip these tests in INT."
2525

26+
SKIP_UPDATE_CAPABILITIES_TESTS = os.getenv("COMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST", "false") == "true"
27+
SKIP_UPDATE_CAPABILITIES_TESTS_REASON = "Phone number capabilities update does not currently support parallel execution. Skip these tests from live test pipeline."
28+
2629
class PhoneNumbersClientTestAsync(AsyncCommunicationTestCase):
2730
def setUp(self):
2831
super(PhoneNumbersClientTestAsync, self).setUp()
@@ -129,6 +132,7 @@ async def test_search_available_phone_numbers(self):
129132
assert poller.result()
130133

131134
@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
135+
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
132136
@AsyncCommunicationTestCase.await_prepared_test
133137
async def test_update_phone_number_capabilities(self):
134138
async with self.phone_number_client:
@@ -145,6 +149,7 @@ async def test_update_phone_number_capabilities(self):
145149
assert poller.status() == PhoneNumberOperationStatus.SUCCEEDED.value
146150

147151
@pytest.mark.skipif(SKIP_INT_PHONE_NUMBER_TESTS, reason=INT_PHONE_NUMBER_TEST_SKIP_REASON)
152+
@pytest.mark.skipif(SKIP_UPDATE_CAPABILITIES_TESTS, reason=SKIP_UPDATE_CAPABILITIES_TESTS_REASON)
148153
@AsyncCommunicationTestCase.await_prepared_test
149154
async def test_update_phone_number_capabilities_from_managed_identity(self):
150155
endpoint, access_key = parse_connection_str(self.connection_str)

sdk/communication/azure-communication-phonenumbers/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ stages:
1919
- $(sub-config-communication-int-test-resources-common)
2020
- $(sub-config-communication-int-test-resources-python)
2121
Clouds: Public,Int
22+
EnvVars:
23+
COMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST: true

0 commit comments

Comments
 (0)