Skip to content

Commit c1b2047

Browse files
gladjohnCopilot
andcommitted
ci(mi-e2e): run pytest directly on self-hosted pools; drop runtime pip install
The self-hosted MI E2E pools carry the toolchain (like Go/.NET); pre-provision msal's deps + pytest on them instead of installing at run time. This removes the runtime "pip install", which the Azure Arc pool cannot do anyway - its egress TLS inspection blocks files.pythonhosted.org (the same restriction MSAL Go documented). Also drop --timeout so pytest-timeout is not required. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5ad57850-7d1f-4b9a-bf9f-723d69a9687c
1 parent f1bac74 commit c1b2047

1 file changed

Lines changed: 10 additions & 24 deletions

File tree

.Pipelines/template-pipeline-stages.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -305,26 +305,19 @@ stages:
305305
variables:
306306
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
307307
steps:
308-
- task: PowerShell@2
309-
displayName: 'Install Python dependencies'
310-
inputs:
311-
targetType: 'inline'
312-
workingDirectory: '$(System.DefaultWorkingDirectory)'
313-
script: |
314-
python --version
315-
python -m pip install --upgrade pip
316-
python -m pip install -r requirements.txt
317-
python -m pip install pytest pytest-azurepipelines pytest-timeout
318-
308+
# msal + its dependencies (requests, cryptography, PyJWT) and pytest are PRE-PROVISIONED on the
309+
# self-hosted pool (like the Go/.NET toolchains already are), so there is no runtime pip install.
310+
# This also avoids the Arc pool's egress TLS inspection blocking files.pythonhosted.org.
319311
- task: PowerShell@2
320312
displayName: 'Run pytest (MI E2E - IMDS)'
321313
inputs:
322314
targetType: 'inline'
323315
workingDirectory: '$(System.DefaultWorkingDirectory)'
324316
script: |
325317
$ErrorActionPreference = 'Stop'
318+
python --version
326319
New-Item -ItemType Directory -Force -Path test-results | Out-Null
327-
python -m pytest -vv --timeout=300 --junitxml=test-results/junit-mi-e2e-imds.xml tests/test_mi_e2e.py
320+
python -m pytest -vv --junitxml=test-results/junit-mi-e2e-imds.xml tests/test_mi_e2e.py
328321
env:
329322
PYTHONUNBUFFERED: '1'
330323
MSAL_TEST_MI_IMDS: '1'
@@ -364,26 +357,19 @@ stages:
364357
variables:
365358
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
366359
steps:
367-
- task: PowerShell@2
368-
displayName: 'Install Python dependencies'
369-
inputs:
370-
targetType: 'inline'
371-
workingDirectory: '$(System.DefaultWorkingDirectory)'
372-
script: |
373-
python --version
374-
python -m pip install --upgrade pip
375-
python -m pip install -r requirements.txt
376-
python -m pip install pytest pytest-azurepipelines pytest-timeout
377-
360+
# msal + its dependencies (requests, cryptography, PyJWT) and pytest are PRE-PROVISIONED on the
361+
# self-hosted pool (like the Go/.NET toolchains already are), so there is no runtime pip install.
362+
# This is required here because the Arc machine's egress TLS inspection blocks files.pythonhosted.org.
378363
- task: PowerShell@2
379364
displayName: 'Run pytest (MI E2E - Azure Arc)'
380365
inputs:
381366
targetType: 'inline'
382367
workingDirectory: '$(System.DefaultWorkingDirectory)'
383368
script: |
384369
$ErrorActionPreference = 'Stop'
370+
python --version
385371
New-Item -ItemType Directory -Force -Path test-results | Out-Null
386-
python -m pytest -vv --timeout=300 --junitxml=test-results/junit-mi-e2e-arc.xml tests/test_mi_e2e.py
372+
python -m pytest -vv --junitxml=test-results/junit-mi-e2e-arc.xml tests/test_mi_e2e.py
387373
env:
388374
PYTHONUNBUFFERED: '1'
389375

0 commit comments

Comments
 (0)