Skip to content

Commit b776eb8

Browse files
authored
Live test update & issue fix (#28040)
1 parent eb1f793 commit b776eb8

File tree

3 files changed

+82
-62
lines changed

3 files changed

+82
-62
lines changed

.azure-pipelines/live-test.yml

Lines changed: 27 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ parameters:
1313
default: ' '
1414

1515
variables:
16-
os_windows_2019: windows-2019
17-
os_windows_2022: windows-2022
16+
os_windows: windows-latest
1817
os_linux: ubuntu-latest
1918
os_macos: macOS-latest
2019
win_ps_5_1: 5.1
@@ -36,8 +35,8 @@ stages:
3635
jobs:
3736
- template: util/live-test-steps.yml
3837
parameters:
39-
name: 'win_ps_5_1_win_2019'
40-
vmImage: ${{ variables.os_windows_2019 }}
38+
name: 'ps_5_1_windows'
39+
vmImage: ${{ variables.os_windows }}
4140
osType: 'Windows'
4241
psVersion: ${{ variables.win_ps_5_1 }}
4342
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
@@ -46,18 +45,8 @@ stages:
4645

4746
- template: util/live-test-steps.yml
4847
parameters:
49-
name: 'win_ps_5_1_win_2022'
50-
vmImage: ${{ variables.os_windows_2022 }}
51-
osType: 'Windows'
52-
psVersion: ${{ variables.win_ps_5_1 }}
53-
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
54-
galleryName: ${{ parameters.GalleryName }}
55-
pipelineBuildId: ${{ parameters.PipelineBuildId }}
56-
57-
- template: util/live-test-steps.yml
58-
parameters:
59-
name: 'ps_7_4_x_win_2019'
60-
vmImage: ${{ variables.os_windows_2019 }}
48+
name: 'ps_7_4_x_windows'
49+
vmImage: ${{ variables.os_windows }}
6150
osType: 'Windows'
6251
psVersion: ${{ variables.ps_7_4_x }}
6352
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
@@ -66,8 +55,8 @@ stages:
6655

6756
- template: util/live-test-steps.yml
6857
parameters:
69-
name: 'ps_7_5_x_win_2019'
70-
vmImage: ${{ variables.os_windows_2019 }}
58+
name: 'ps_7_5_x_windows'
59+
vmImage: ${{ variables.os_windows }}
7160
osType: 'Windows'
7261
psVersion: ${{ variables.ps_7_5_x }}
7362
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
@@ -76,8 +65,8 @@ stages:
7665

7766
- template: util/live-test-steps.yml
7867
parameters:
79-
name: 'ps_latest_win_2019'
80-
vmImage: ${{ variables.os_windows_2019 }}
68+
name: 'ps_latest_windows'
69+
vmImage: ${{ variables.os_windows }}
8170
osType: 'Windows'
8271
psVersion: ${{ variables.ps_latest }}
8372
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
@@ -86,88 +75,64 @@ stages:
8675

8776
- template: util/live-test-steps.yml
8877
parameters:
89-
name: 'ps_7_4_x_win_2022'
90-
vmImage: ${{ variables.os_windows_2022 }}
91-
osType: 'Windows'
78+
name: 'ps_7_4_x_linux'
79+
vmImage: ${{ variables.os_linux }}
80+
osType: 'Linux'
9281
psVersion: ${{ variables.ps_7_4_x }}
9382
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
9483
galleryName: ${{ parameters.GalleryName }}
9584
pipelineBuildId: ${{ parameters.PipelineBuildId }}
9685

9786
- template: util/live-test-steps.yml
9887
parameters:
99-
name: 'ps_7_5_x_win_2022'
100-
vmImage: ${{ variables.os_windows_2022 }}
101-
osType: 'Windows'
88+
name: 'ps_7_5_x_linux'
89+
vmImage: ${{ variables.os_linux }}
90+
osType: 'Linux'
10291
psVersion: ${{ variables.ps_7_5_x }}
10392
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
10493
galleryName: ${{ parameters.GalleryName }}
10594
pipelineBuildId: ${{ parameters.PipelineBuildId }}
10695

10796
- template: util/live-test-steps.yml
10897
parameters:
109-
name: 'ps_latest_win_2022'
110-
vmImage: ${{ variables.os_windows_2022 }}
111-
osType: 'Windows'
98+
name: 'ps_latest_linux'
99+
vmImage: ${{ variables.os_linux }}
100+
osType: 'Linux'
112101
psVersion: ${{ variables.ps_latest }}
113102
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
114103
galleryName: ${{ parameters.GalleryName }}
115104
pipelineBuildId: ${{ parameters.PipelineBuildId }}
116105

117106
- template: util/live-test-steps.yml
118107
parameters:
119-
name: 'ps_7_4_x_linux'
120-
vmImage: ${{ variables.os_linux }}
121-
osType: 'Linux'
108+
name: 'ps_7_4_x_macos'
109+
vmImage: ${{ variables.os_macos }}
110+
osType: 'MacOS'
122111
psVersion: ${{ variables.ps_7_4_x }}
123112
dotnetVersion: ${{ variables.dotnet_sdk_8 }}
124113
galleryName: ${{ parameters.GalleryName }}
125114
pipelineBuildId: ${{ parameters.PipelineBuildId }}
126115

127116
- template: util/live-test-steps.yml
128117
parameters:
129-
name: 'ps_7_5_x_linux'
130-
vmImage: ${{ variables.os_linux }}
131-
osType: 'Linux'
118+
name: 'ps_7_5_x_macos'
119+
vmImage: ${{ variables.os_macos }}
120+
osType: 'MacOS'
132121
psVersion: ${{ variables.ps_7_5_x }}
133122
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
134123
galleryName: ${{ parameters.GalleryName }}
135124
pipelineBuildId: ${{ parameters.PipelineBuildId }}
136125

137126
- template: util/live-test-steps.yml
138127
parameters:
139-
name: 'ps_latest_linux'
140-
vmImage: ${{ variables.os_linux }}
141-
osType: 'Linux'
128+
name: 'ps_latest_macos'
129+
vmImage: ${{ variables.os_macos }}
130+
osType: 'MacOS'
142131
psVersion: ${{ variables.ps_latest }}
143132
dotnetVersion: ${{ variables.dotnet_sdk_9 }}
144133
galleryName: ${{ parameters.GalleryName }}
145134
pipelineBuildId: ${{ parameters.PipelineBuildId }}
146135

147-
# - template: util/live-test-steps.yml
148-
# parameters:
149-
# name: 'ps_7_4_x_macOS'
150-
# vmImage: ${{ variables.os_macos }}
151-
# osType: 'MacOS'
152-
# psVersion: ${{ variables.ps_7_4_x }}
153-
# dotnetVersion: ${{ variables.dotnet_sdk_8 }}
154-
155-
# - template: util/live-test-steps.yml
156-
# parameters:
157-
# name: 'ps_7_5_x_macOS'
158-
# vmImage: ${{ variables.os_macos }}
159-
# osType: 'MacOS'
160-
# psVersion: ${{ variables.ps_7_5_x }}
161-
# dotnetVersion: ${{ variables.dotnet_sdk_9 }}
162-
163-
# - template: util/live-test-steps.yml
164-
# parameters:
165-
# name: 'ps_latest_macOS'
166-
# vmImage: ${{ variables.os_macos }}
167-
# osType: 'MacOS'
168-
# psVersion: ${{ variables.ps_latest }}
169-
# dotnetVersion: ${{ variables.dotnet_sdk_9 }}
170-
171136
- stage: Report
172137
displayName: Send Report
173138
condition: always()

.azure-pipelines/util/live-test-steps.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ jobs:
9797
outVar: 'LiveTestServicePrincipalSecret'
9898
execCondition: and(succeeded(), ne(variables['skipLatest'], 'true'))
9999

100+
- task: Bash@3
101+
displayName: Clean up Azure Identity Keys from MacOS Keychain
102+
condition: and(succeeded(), ne(variables['skipLatest'], 'true'), ${{ eq(parameters.osType, 'MacOS') }})
103+
continueOnError: true
104+
inputs:
105+
targetType: filePath
106+
filePath: ./tools/TestFx/Live/CleanAzureIdentityKeysForMacOS
107+
failOnStderr: false
108+
env:
109+
KEYCHAIN_SERVICES: '$(AzureIdentityKeychainServices)'
110+
100111
- task: PowerShell@2
101112
displayName: Connect Azure with live test service principal
102113
condition: and(succeeded(), ne(variables['skipLatest'], 'true'))
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# Purpose: Clean up Azure Identity Keys from the MacOS Keychain
3+
4+
cleanup_service_from_keychain() {
5+
local service_name="$1"
6+
echo "Processing keychain entry: $service_name"
7+
8+
if security find-generic-password -s "$service_name" &> /dev/null; then
9+
echo "##[section]Found keychain entry for '$service_name'. Attempting to delete..."
10+
11+
if security delete-generic-password -s "$service_name" &> /dev/null; then
12+
echo "##[section]Successfully deleted '$service_name' from keychain."
13+
return 0
14+
else
15+
echo "##[warning]Failed to delete '$service_name' from keychain."
16+
return 1
17+
fi
18+
else
19+
echo "##[warning]No keychain entry found for '$service_name'."
20+
return 0
21+
fi
22+
}
23+
24+
if [ -n "$KEYCHAIN_SERVICES" ]; then
25+
IFS=',' read -ra SERVICES_TO_CLEAN <<< "$KEYCHAIN_SERVICES"
26+
echo "Keychain services to be cleaned up: $KEYCHAIN_SERVICES"
27+
echo
28+
29+
CLEANUP_FAILED=0
30+
for service in "${SERVICES_TO_CLEAN[@]}"; do
31+
if ! cleanup_service_from_keychain "$service"; then
32+
CLEANUP_FAILED=1
33+
fi
34+
echo
35+
done
36+
37+
if [ $CLEANUP_FAILED -eq 1 ]; then
38+
echo "##[warning]Some keychain entries could not be removed"
39+
else
40+
echo "##[section]All keychain services cleaned up successfully"
41+
fi
42+
else
43+
echo "##[warning]No keychain services specified for cleanup."
44+
fi

0 commit comments

Comments
 (0)