[Communication] - phone-numbers - Implement a phone number pool for update capabilities live tests #23116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements a simple pool of available phone numbers to use in live test pipelines. This solves an issue with the update capabilities live tests caused when multiple tests attempt to modify the state of a phone number simultaneously.
In order to make use of this, the following environment variables need to be passed:
AZURE_TEST_AGENT
specifies the OS and runtime configuration for the job. It should contain the OS, the OS version and the framework/runtime version separated by underscores; e.g.windows_2019_python36
.AZURE_PHONE_NUMBER_<AZURE_TEST_AGENT>
, where<AZURE_TEST_AGENT>
corresponds to the value of the variable described prior; e.g.AZURE_PHONE_NUMBER_windows_2019_python36
.Additionally, by setting the
COMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST
variable totrue
, update capabilities tests can be skipped altoghether. This is useful because the amount of phone numbers available for testing (currently limited to 3) is smaller than the number of test jobs running in parallel.NOTE: If either the
AZURE_TEST_AGENT
orAZURE_PHONE_NUMBER_<AZURE_TEST_AGENT>
are not present when running live tests andCOMMUNICATION_SKIP_CAPABILITIES_LIVE_TEST=false
, then the test run will fail. In any other scenario, theAZURE_PHONE_NUMBER
will be used.This PR is a follow-up to #22911.