@@ -138,6 +138,14 @@ steps:
138138 - ${{ parameters.AfterTestSteps }}
139139
140140 - pwsh : |
141+ if ($IsWindows) {
142+ . $(VENV_LOCATION)/Scripts/Activate.ps1
143+ }
144+ else {
145+ . $(VENV_LOCATION)/bin/activate.ps1
146+ }
147+ Write-Host (Get-Command python).Source
148+
141149 python -m pip install coverage==7.2.5
142150 python scripts/devops_tasks/create_coverage.py
143151 displayName: Create Coverage Report
@@ -156,6 +164,13 @@ steps:
156164 pwsh : true
157165 ScriptType : InlineScript
158166 Inline : >-
167+ if ($IsWindows) {
168+ . $(VENV_LOCATION)/Scripts/Activate.ps1
169+ }
170+ else {
171+ . $(VENV_LOCATION)/bin/activate.ps1
172+ }
173+ Write-Host (Get-Command python).Source
159174 $account = (Get-AzContext).Account;
160175 $env:AZURESUBSCRIPTION_CLIENT_ID = $account.Id;
161176 $env:AZURESUBSCRIPTION_TENANT_ID = $account.Tenants;
@@ -166,18 +181,22 @@ steps:
166181 --toxenv="samples";
167182 Write-Host "Last exit code: $LASTEXITCODE";
168183 exit $LASTEXITCODE;
169-
170184 - ${{ else }} :
171- - task : PythonScript@0
172- displayName : ' Test Samples'
173- condition : and(succeeded(), eq(variables['TestSamples'], 'true'))
174- inputs :
175- scriptPath : ' scripts/devops_tasks/dispatch_tox.py'
176- arguments : >-
177- "$(TargetingString)"
178- --service="${{ parameters.ServiceDirectory }}"
185+ - pwsh : |
186+ if ($IsWindows) {
187+ . $(VENV_LOCATION)/Scripts/Activate.ps1
188+ }
189+ else {
190+ . $(VENV_LOCATION)/bin/activate.ps1
191+ }
192+ Write-Host (Get-Command python).Source
193+ python scripts/devops_tasks/dispatch_tox.py "$(TargetingString)" `
194+ --service="${{ parameters.ServiceDirectory }}" `
179195 --toxenv="samples"
196+ exit $LASTEXITCODE;
180197 env: ${{ parameters.EnvVars }}
198+ displayName: 'Test Samples'
199+ condition: and(succeeded(), eq(variables['TestSamples'], 'true'))
181200
182201 - task : PublishTestResults@2
183202 condition : always()
0 commit comments