diff --git a/eng/pipelines/templates/steps/build-test.yml b/eng/pipelines/templates/steps/build-test.yml index 8364a124cb4e..c680c483e5d5 100644 --- a/eng/pipelines/templates/steps/build-test.yml +++ b/eng/pipelines/templates/steps/build-test.yml @@ -44,6 +44,8 @@ steps: $(PIP_EXE) freeze displayName: 'Prep Environment' + # this needs to move under eng/scripts from scripts/devops_tasks/ + # AND be renamed prior to merging any PR with this changeset - task: PythonScript@0 displayName: 'Set Tox Environment' inputs: @@ -64,10 +66,7 @@ steps: - ${{ parameters.BeforeTestSteps }} - - template: /eng/pipelines/templates/steps/seed-virtualenv-wheels.yml - - ${{ if eq('true', parameters.UseFederatedAuth) }}: - - task: AzurePowerShell@5 displayName: Run Tests (AzurePowerShell@5) env: @@ -79,6 +78,7 @@ steps: pwsh: true ScriptType: InlineScript Inline: >- + $env:TOX_PIP_IMPL="uv" $account = (Get-AzContext).Account; $env:AZURESUBSCRIPTION_CLIENT_ID = $account.Id; $env:AZURESUBSCRIPTION_TENANT_ID = $account.Tenants; @@ -92,20 +92,20 @@ steps: $markArg = "${{ parameters.TestMarkArgument }}" } - python scripts/devops_tasks/dispatch_tox.py + python eng/scripts/dispatch_checks.py "$(TargetingString)" ${{ parameters.AdditionalTestArgs }} ${{ parameters.CoverageArg }} --mark_arg="$markArg" --service="${{ parameters.ServiceDirectory }}" - --toxenv="${{ parameters.ToxTestEnv }}" + --checks="${{ parameters.ToxTestEnv }}" --injected-packages="${{ parameters.InjectedPackages }}" - --tenvparallel="${{ parameters.ToxEnvParallel }}"; Write-Host "Last exit code: $LASTEXITCODE"; exit $LASTEXITCODE; - ${{ else }}: - pwsh: | + $env:TOX_PIP_IMPL="uv" Write-Host (Get-Command python).Source if ($env:TESTMARKARGUMENT) { @@ -115,14 +115,13 @@ steps: $markArg = "${{ parameters.TestMarkArgument }}" } - python scripts/devops_tasks/dispatch_tox.py "$(TargetingString)" ` + python eng/scripts/dispatch_checks.py "$(TargetingString)" ` ${{ parameters.AdditionalTestArgs }} ` ${{ parameters.CoverageArg }} ` --mark_arg="$markArg" ` --service="${{ parameters.ServiceDirectory }}" ` - --toxenv="${{ parameters.ToxTestEnv }}" ` - --injected-packages="${{ parameters.InjectedPackages }}" ` - --tenvparallel="${{ parameters.ToxEnvParallel }}"; + --checks="${{ parameters.ToxTestEnv }}" ` + --injected-packages="${{ parameters.InjectedPackages }}" exit $LASTEXITCODE; env: ${{ parameters.EnvVars }} displayName: Run Tests @@ -147,49 +146,44 @@ steps: displayName: Report Coverage condition: and(succeeded(), ${{ parameters.RunCoverage }}) - - ${{ if eq('true', parameters.UseFederatedAuth) }}: - - task: AzurePowerShell@5 - displayName: Test Samples (AzurePowerShell@5) - condition: and(succeeded(), eq(variables['TestSamples'], 'true')) - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - # Enable samples tests that use DefaultAzureCredential to load the federated pipeline credential - AZURE_POD_IDENTITY_AUTHORITY_HOST: 'https://FakeAuthorityHost' - ${{ insert }}: ${{ parameters.EnvVars }} - inputs: - azureSubscription: azure-sdk-tests-public - azurePowerShellVersion: LatestVersion - pwsh: true - ScriptType: InlineScript - Inline: | - $account = (Get-AzContext).Account; - $env:AZURESUBSCRIPTION_CLIENT_ID = $account.Id; - $env:AZURESUBSCRIPTION_TENANT_ID = $account.Tenants; - - Write-Host (Get-Command python).Source - - python scripts/devops_tasks/dispatch_tox.py "$(TargetingString)" ` - --service="${{ parameters.ServiceDirectory }}" ` - --toxenv="samples" - - Write-Host "Last exit code: $LASTEXITCODE"; - exit $LASTEXITCODE; - - ${{ else }}: - - pwsh: | - if ($IsWindows) { - . $(VENV_LOCATION)/Scripts/Activate.ps1 - } - else { - . $(VENV_LOCATION)/bin/activate.ps1 - } - Write-Host (Get-Command python).Source - python scripts/devops_tasks/dispatch_tox.py "$(TargetingString)" ` - --service="${{ parameters.ServiceDirectory }}" ` - --toxenv="samples" - exit $LASTEXITCODE; - env: ${{ parameters.EnvVars }} - displayName: 'Test Samples' - condition: and(succeeded(), eq(variables['TestSamples'], 'true')) + # re-enable after migrating `samples` + # - ${{ if eq('true', parameters.UseFederatedAuth) }}: + # - task: AzurePowerShell@5 + # displayName: Test Samples (AzurePowerShell@5) + # condition: and(succeeded(), eq(variables['TestSamples'], 'true')) + # env: + # SYSTEM_ACCESSTOKEN: $(System.AccessToken) + # # Enable samples tests that use DefaultAzureCredential to load the federated pipeline credential + # AZURE_POD_IDENTITY_AUTHORITY_HOST: 'https://FakeAuthorityHost' + # ${{ insert }}: ${{ parameters.EnvVars }} + # inputs: + # azureSubscription: azure-sdk-tests-public + # azurePowerShellVersion: LatestVersion + # pwsh: true + # ScriptType: InlineScript + # Inline: | + # $account = (Get-AzContext).Account; + # $env:AZURESUBSCRIPTION_CLIENT_ID = $account.Id; + # $env:AZURESUBSCRIPTION_TENANT_ID = $account.Tenants; + + # Write-Host (Get-Command python).Source + + # python eng/scripts/dispatch_checks.py "$(TargetingString)" ` + # --service="${{ parameters.ServiceDirectory }}" ` + # --checks="samples" + + # Write-Host "Last exit code: $LASTEXITCODE"; + # exit $LASTEXITCODE; + # - ${{ else }}: + # - pwsh: | + # Write-Host (Get-Command python).Source + # python eng/scripts/dispatch_checks.py "$(TargetingString)" ` + # --service="${{ parameters.ServiceDirectory }}" ` + # --checks="samples" + # exit $LASTEXITCODE; + # env: ${{ parameters.EnvVars }} + # displayName: 'Test Samples' + # condition: and(succeeded(), eq(variables['TestSamples'], 'true')) - task: PublishTestResults@2 condition: always() diff --git a/eng/scripts/dispatch_checks.py b/eng/scripts/dispatch_checks.py index 498e7194cc9c..756f4655a2b9 100644 --- a/eng/scripts/dispatch_checks.py +++ b/eng/scripts/dispatch_checks.py @@ -77,6 +77,9 @@ async def run_check( # Print captured output after completion to avoid interleaving header = f"===== OUTPUT: {check} :: {package} (exit {exit_code}) =====" trailer = "=" * len(header) + if in_ci(): + print(f"##[group]{package} :: {check}") + if stdout: print(header) print(stdout.rstrip()) @@ -86,6 +89,9 @@ async def run_check( print(stderr.rstrip()) print(trailer) + if in_ci(): + print("##[endgroup]") + # if we have any output collections to complete, do so now here # finally, we need to clean up any temp dirs created by --isolate diff --git a/scripts/devops_tasks/set_tox_environment.py b/scripts/devops_tasks/set_tox_environment.py index fa689640ee55..1e8f8f0870cc 100644 --- a/scripts/devops_tasks/set_tox_environment.py +++ b/scripts/devops_tasks/set_tox_environment.py @@ -14,13 +14,14 @@ FULL_BUILD_SET = [ "whl", - "sdist", - "depends", - "latestdependency", - "mindependency", - "whl_no_aio", + # "sdist", + # "depends", + # "latestdependency", + # "mindependency", + # "whl_no_aio", ] -PR_BUILD_SET = ["whl", "sdist", "mindependency"] +# this branch is checking only whl for now. rest will follow as they migrate +PR_BUILD_SET = ["whl"] #, "sdist", "mindependency" def resolve_devops_variable(var_value: str) -> List[str]: