@@ -33,22 +33,25 @@ steps:
33
33
parameters :
34
34
versionSpec : ' ${{ parameters.PythonVersion }}'
35
35
36
+ - template : /eng/pipelines/templates/steps/use-venv.yml
37
+
36
38
- template : set-dev-build.yml
37
39
parameters :
38
40
ServiceDirectory : ${{ parameters.ServiceDirectory }}
39
41
40
42
- pwsh : |
41
- Write-Host (Get-Command python).Source
43
+ if ($IsWindows) {
44
+ . $(VENV_LOCATION)/Scripts/Activate.ps1
45
+ }
46
+ else {
47
+ . $(VENV_LOCATION)/bin/activate.ps1
48
+ }
42
49
$ErrorActionPreference = 'Stop'
43
50
$PSNativeCommandUseErrorActionPreference = $true
44
- python -m pip freeze
45
- python -m pip install pip==23.2.1
46
- python -m pip install wheel==0.43.0 --force-reinstall
47
- python -m pip install setuptools==69.2.0 --force-reinstall
48
- python -m pip install -r eng/ci_tools.txt
49
- pip --version
50
- pip freeze
51
- displayName: 'Prep Environment Linux/Mac'
51
+ python -m pip install --force -r eng/ci_tools.txt
52
+ python -m pip freeze --all
53
+ Write-Host (Get-Command python).Source
54
+ displayName: 'Prep Environment'
52
55
53
56
- ${{if eq(parameters.TestProxy, true) }} :
54
57
- template : /eng/common/testproxy/test-proxy-tool.yml
65
68
- template : /eng/pipelines/templates/steps/seed-virtualenv-wheels.yml
66
69
67
70
- ${{ if eq('true', parameters.UseFederatedAuth) }} :
71
+
68
72
- task : AzurePowerShell@5
69
73
displayName : Run Tests (AzurePowerShell@5)
70
74
env :
@@ -76,6 +80,13 @@ steps:
76
80
pwsh : true
77
81
ScriptType : InlineScript
78
82
Inline : >-
83
+ if ($IsWindows) {
84
+ . $(VENV_LOCATION)/Scripts/Activate.ps1
85
+ }
86
+ else {
87
+ . $(VENV_LOCATION)/bin/activate.ps1
88
+ }
89
+ Write-Host (Get-Command python).Source
79
90
$account = (Get-AzContext).Account;
80
91
$env:AZURESUBSCRIPTION_CLIENT_ID = $account.Id;
81
92
$env:AZURESUBSCRIPTION_TENANT_ID = $account.Tenants;
@@ -93,20 +104,25 @@ steps:
93
104
exit $LASTEXITCODE;
94
105
95
106
- ${{ else }} :
96
- - task : PythonScript@0
97
- displayName : ' Run Tests'
98
- inputs :
99
- scriptPath : ' scripts/devops_tasks/dispatch_tox.py'
100
- arguments : >-
101
- "$(TargetingString)"
102
- ${{ parameters.AdditionalTestArgs }}
103
- ${{ parameters.CoverageArg }}
104
- --mark_arg="${{ parameters.TestMarkArgument }}"
105
- --service="${{ parameters.ServiceDirectory }}"
106
- --toxenv="${{ parameters.ToxTestEnv }}"
107
- --injected-packages="${{ parameters.InjectedPackages }}"
107
+ - pwsh : |
108
+ if ($IsWindows) {
109
+ . $(VENV_LOCATION)/Scripts/Activate.ps1
110
+ }
111
+ else {
112
+ . $(VENV_LOCATION)/bin/activate.ps1
113
+ }
114
+ Write-Host (Get-Command python).Source
115
+ python scripts/devops_tasks/dispatch_tox.py "$(TargetingString)" `
116
+ ${{ parameters.AdditionalTestArgs }} `
117
+ ${{ parameters.CoverageArg }} `
118
+ --mark_arg="${{ parameters.TestMarkArgument }}" `
119
+ --service="${{ parameters.ServiceDirectory }}" `
120
+ --toxenv="${{ parameters.ToxTestEnv }}" `
121
+ --injected-packages="${{ parameters.InjectedPackages }}" `
108
122
${{ parameters.ToxEnvParallel }}
123
+ exit $LASTEXITCODE;
109
124
env: ${{ parameters.EnvVars }}
125
+ displayName: Run Tests
110
126
111
127
- ${{if eq(parameters.TestProxy, true) }} :
112
128
- pwsh : |
0 commit comments