diff --git a/eng/ci_tools.txt b/eng/ci_tools.txt index 92d6682453e1..6b7348e9adca 100644 --- a/eng/ci_tools.txt +++ b/eng/ci_tools.txt @@ -1,6 +1,7 @@ # requirements leveraged by ci tools setuptools==44.1.0; python_version == '2.7' setuptools==45.1.0; python_version >= '3.5' +virtualenv==20.0.24 wheel==0.34.2 Jinja2==2.11.1 packaging==20.4 @@ -32,4 +33,3 @@ pytest-cov==2.8.1 ./tools/azure-sdk-tools - diff --git a/eng/pipelines/templates/steps/build-test.yml b/eng/pipelines/templates/steps/build-test.yml index bc8451d96b5e..10aad24725d2 100644 --- a/eng/pipelines/templates/steps/build-test.yml +++ b/eng/pipelines/templates/steps/build-test.yml @@ -26,27 +26,27 @@ steps: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - script: | - python -m pip install pip == 20.1 - pip install -r eng/ci_tools.txt - pip --version + python -m pip install -r eng/ci_tools.txt + mkdir $(Build.SourcesDirectory)/env + python -m virtualenv $(Build.SourcesDirectory)/env displayName: 'Prep Environment' - ${{ parameters.BeforeTestSteps }} - - task: PythonScript@0 - displayName: 'Run Tests' - inputs: - scriptPath: 'scripts/devops_tasks/setup_execute_tests.py' - arguments: >- - "${{ parameters.BuildTargetingString }}" - ${{ parameters.AdditionalTestArgs }} - ${{ parameters.CoverageArg }} - --mark_arg="${{ parameters.TestMarkArgument }}" - --service="${{ parameters.ServiceDirectory }}" - --toxenv="${{ parameters.ToxTestEnv }}" - --injected-packages="${{ parameters.InjectedPackages }}" - ${{ parameters.ToxEnvParallel }} + - pwsh: | + $env:Path = "$(Build.SourcesDirectory)/env;" + $env:Path + python -m pip install pip==20.1 + python -m pip install -r eng/ci_tools.txt + python -m pip --version + + $env:PYTHON_HOME = "" + $env:VIRTUAL_ENV = "$(Build.SourcesDirectory)/env" + + Write-Host 'python ./scripts/devops_tasks/setup_execute_tests.py "${{ parameters.BuildTargetingString }}" ${{ parameters.AdditionalTestArgs }} ${{ parameters.CoverageArg }} --mark_arg="${{ parameters.TestMarkArgument }}" --service="${{ parameters.ServiceDirectory }}" --toxenv="${{ parameters.ToxTestEnv }}" --injected-packages="${{ parameters.InjectedPackages }}" ${{ parameters.ToxEnvParallel }}"' + python ./scripts/devops_tasks/setup_execute_tests.py "${{ parameters.BuildTargetingString }}" ${{ parameters.AdditionalTestArgs }} ${{ parameters.CoverageArg }} --mark_arg="${{ parameters.TestMarkArgument }}" --service="${{ parameters.ServiceDirectory }}" --toxenv="${{ parameters.ToxTestEnv }}" --injected-packages="${{ parameters.InjectedPackages }}" ${{ parameters.ToxEnvParallel }} + env: ${{ parameters.EnvVars }} + displayName: 'Run Tests' - ${{ parameters.AfterTestSteps }}