Skip to content

Commit c67a53c

Browse files
authored
[Identity] Add envvar to toggle SP live test skip (#44085)
For security reasons, a service principal for testing is unavailable during CI live test runs. A toggle was added to more easily toggle these tests, and it is set to True by default (SP tests are skipped). Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
1 parent 880663f commit c67a53c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

sdk/identity/azure-identity/tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def record_imds_test(request):
6363
@pytest.fixture()
6464
def live_service_principal():
6565
"""Fixture for live Identity tests. Skips them when environment configuration is incomplete."""
66+
if os.environ.get("AZURE_SKIP_SP_LIVE_TESTS", "False").lower() == "true":
67+
pytest.skip("Skipping live service principal tests as per AZURE_SKIP_SP_LIVE_TESTS environment variable.")
6668
missing_variables = [
6769
v
6870
for v in (

sdk/identity/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extends:
1515
PEM_CONTENT: $(python-identity-certificate)
1616
AZURE_TEST_RUN_LIVE: true
1717
AZURE_SKIP_LIVE_RECORDING: 'True'
18+
AZURE_SKIP_SP_LIVE_TESTS: 'True'
1819
CloudConfig:
1920
Public:
2021
SubscriptionConfigurations:

0 commit comments

Comments
 (0)