Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 27 additions & 62 deletions .azure-pipelines/live-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ parameters:
default: ' '

variables:
os_windows_2019: windows-2019
os_windows_2022: windows-2022
os_windows: windows-latest
os_linux: ubuntu-latest
os_macos: macOS-latest
win_ps_5_1: 5.1
Expand All @@ -36,8 +35,8 @@ stages:
jobs:
- template: util/live-test-steps.yml
parameters:
name: 'win_ps_5_1_win_2019'
vmImage: ${{ variables.os_windows_2019 }}
name: 'ps_5_1_windows'
vmImage: ${{ variables.os_windows }}
osType: 'Windows'
psVersion: ${{ variables.win_ps_5_1 }}
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
Expand All @@ -46,18 +45,8 @@ stages:

- template: util/live-test-steps.yml
parameters:
name: 'win_ps_5_1_win_2022'
vmImage: ${{ variables.os_windows_2022 }}
osType: 'Windows'
psVersion: ${{ variables.win_ps_5_1 }}
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
galleryName: ${{ parameters.GalleryName }}
pipelineBuildId: ${{ parameters.PipelineBuildId }}

- template: util/live-test-steps.yml
parameters:
name: 'ps_7_4_x_win_2019'
vmImage: ${{ variables.os_windows_2019 }}
name: 'ps_7_4_x_windows'
vmImage: ${{ variables.os_windows }}
osType: 'Windows'
psVersion: ${{ variables.ps_7_4_x }}
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
Expand All @@ -66,8 +55,8 @@ stages:

- template: util/live-test-steps.yml
parameters:
name: 'ps_7_5_x_win_2019'
vmImage: ${{ variables.os_windows_2019 }}
name: 'ps_7_5_x_windows'
vmImage: ${{ variables.os_windows }}
osType: 'Windows'
psVersion: ${{ variables.ps_7_5_x }}
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
Expand All @@ -76,8 +65,8 @@ stages:

- template: util/live-test-steps.yml
parameters:
name: 'ps_latest_win_2019'
vmImage: ${{ variables.os_windows_2019 }}
name: 'ps_latest_windows'
vmImage: ${{ variables.os_windows }}
osType: 'Windows'
psVersion: ${{ variables.ps_latest }}
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
Expand All @@ -86,88 +75,64 @@ stages:

- template: util/live-test-steps.yml
parameters:
name: 'ps_7_4_x_win_2022'
vmImage: ${{ variables.os_windows_2022 }}
osType: 'Windows'
name: 'ps_7_4_x_linux'
vmImage: ${{ variables.os_linux }}
osType: 'Linux'
psVersion: ${{ variables.ps_7_4_x }}
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
galleryName: ${{ parameters.GalleryName }}
pipelineBuildId: ${{ parameters.PipelineBuildId }}

- template: util/live-test-steps.yml
parameters:
name: 'ps_7_5_x_win_2022'
vmImage: ${{ variables.os_windows_2022 }}
osType: 'Windows'
name: 'ps_7_5_x_linux'
vmImage: ${{ variables.os_linux }}
osType: 'Linux'
psVersion: ${{ variables.ps_7_5_x }}
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
galleryName: ${{ parameters.GalleryName }}
pipelineBuildId: ${{ parameters.PipelineBuildId }}

- template: util/live-test-steps.yml
parameters:
name: 'ps_latest_win_2022'
vmImage: ${{ variables.os_windows_2022 }}
osType: 'Windows'
name: 'ps_latest_linux'
vmImage: ${{ variables.os_linux }}
osType: 'Linux'
psVersion: ${{ variables.ps_latest }}
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
galleryName: ${{ parameters.GalleryName }}
pipelineBuildId: ${{ parameters.PipelineBuildId }}

- template: util/live-test-steps.yml
parameters:
name: 'ps_7_4_x_linux'
vmImage: ${{ variables.os_linux }}
osType: 'Linux'
name: 'ps_7_4_x_macos'
vmImage: ${{ variables.os_macos }}
osType: 'MacOS'
psVersion: ${{ variables.ps_7_4_x }}
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
galleryName: ${{ parameters.GalleryName }}
pipelineBuildId: ${{ parameters.PipelineBuildId }}

- template: util/live-test-steps.yml
parameters:
name: 'ps_7_5_x_linux'
vmImage: ${{ variables.os_linux }}
osType: 'Linux'
name: 'ps_7_5_x_macos'
vmImage: ${{ variables.os_macos }}
osType: 'MacOS'
psVersion: ${{ variables.ps_7_5_x }}
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
galleryName: ${{ parameters.GalleryName }}
pipelineBuildId: ${{ parameters.PipelineBuildId }}

- template: util/live-test-steps.yml
Copy link

Copilot AI Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] There are multiple commented-out pipeline template invocations; consider removing these unused code blocks to improve maintainability.

Copilot uses AI. Check for mistakes.

parameters:
name: 'ps_latest_linux'
vmImage: ${{ variables.os_linux }}
osType: 'Linux'
name: 'ps_latest_macos'
vmImage: ${{ variables.os_macos }}
osType: 'MacOS'
psVersion: ${{ variables.ps_latest }}
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
galleryName: ${{ parameters.GalleryName }}
pipelineBuildId: ${{ parameters.PipelineBuildId }}

# - template: util/live-test-steps.yml
# parameters:
# name: 'ps_7_4_x_macOS'
# vmImage: ${{ variables.os_macos }}
# osType: 'MacOS'
# psVersion: ${{ variables.ps_7_4_x }}
# dotnetVersion: ${{ variables.dotnet_sdk_8 }}

# - template: util/live-test-steps.yml
# parameters:
# name: 'ps_7_5_x_macOS'
# vmImage: ${{ variables.os_macos }}
# osType: 'MacOS'
# psVersion: ${{ variables.ps_7_5_x }}
# dotnetVersion: ${{ variables.dotnet_sdk_9 }}

# - template: util/live-test-steps.yml
# parameters:
# name: 'ps_latest_macOS'
# vmImage: ${{ variables.os_macos }}
# osType: 'MacOS'
# psVersion: ${{ variables.ps_latest }}
# dotnetVersion: ${{ variables.dotnet_sdk_9 }}

- stage: Report
displayName: Send Report
condition: always()
Expand Down
11 changes: 11 additions & 0 deletions .azure-pipelines/util/live-test-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ jobs:
outVar: 'LiveTestServicePrincipalSecret'
execCondition: and(succeeded(), ne(variables['skipLatest'], 'true'))

- task: Bash@3
displayName: Clean up Azure Identity Keys from MacOS Keychain
condition: and(succeeded(), ne(variables['skipLatest'], 'true'), ${{ eq(parameters.osType, 'MacOS') }})
continueOnError: true
inputs:
targetType: filePath
filePath: ./tools/TestFx/Live/CleanAzureIdentityKeysForMacOS
failOnStderr: false
env:
KEYCHAIN_SERVICES: '$(AzureIdentityKeychainServices)'

- task: PowerShell@2
displayName: Connect Azure with live test service principal
condition: and(succeeded(), ne(variables['skipLatest'], 'true'))
Expand Down
44 changes: 44 additions & 0 deletions tools/TestFx/Live/CleanAzureIdentityKeysForMacOS
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
# Purpose: Clean up Azure Identity Keys from the MacOS Keychain

cleanup_service_from_keychain() {
local service_name="$1"
echo "Processing keychain entry: $service_name"

if security find-generic-password -s "$service_name" &> /dev/null; then
echo "##[section]Found keychain entry for '$service_name'. Attempting to delete..."

if security delete-generic-password -s "$service_name" &> /dev/null; then
echo "##[section]Successfully deleted '$service_name' from keychain."
return 0
else
echo "##[warning]Failed to delete '$service_name' from keychain."
return 1
fi
else
echo "##[warning]No keychain entry found for '$service_name'."
return 0
fi
}

if [ -n "$KEYCHAIN_SERVICES" ]; then
IFS=',' read -ra SERVICES_TO_CLEAN <<< "$KEYCHAIN_SERVICES"
echo "Keychain services to be cleaned up: $KEYCHAIN_SERVICES"
echo

CLEANUP_FAILED=0
for service in "${SERVICES_TO_CLEAN[@]}"; do
if ! cleanup_service_from_keychain "$service"; then
CLEANUP_FAILED=1
fi
echo
done

if [ $CLEANUP_FAILED -eq 1 ]; then
echo "##[warning]Some keychain entries could not be removed"
else
echo "##[section]All keychain services cleaned up successfully"
fi
else
echo "##[warning]No keychain services specified for cleanup."
fi
Loading