Skip to content

Commit 428c685

Browse files
Resolved Copilet comments-2
1 parent 855736c commit 428c685

File tree

7 files changed

+27
-39
lines changed

7 files changed

+27
-39
lines changed

.github/workflows/deploy-orchestrator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
secrets: inherit
101101

102102
e2e-test:
103-
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APP_URL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
103+
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APP_URL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests && inputs.run_e2e_tests != 'None'))"
104104
needs: [docker-build, deploy]
105105
uses: ./.github/workflows/job-test-automation.yml
106106
with:

.github/workflows/job-deploy-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ jobs:
342342
shell: bash
343343
run: |
344344
echo "⚠️ First attempt failed. Retrying process_sample_data.sh..."
345-
sleep 5
345+
sleep 20
346346
bash ./infra/scripts/process_sample_data.sh
347347
echo "✅ Sample data processing completed successfully on retry."
348348

.github/workflows/job-deploy-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ jobs:
372372
PYTHONIOENCODING: utf-8
373373
run: |
374374
echo "⚠️ First attempt failed. Retrying process_sample_data.sh..."
375-
sleep 5
375+
sleep 20
376376
bash ./infra/scripts/process_sample_data.sh
377377
echo "✅ Sample data processing completed successfully on retry."
378378

.github/workflows/job-test-automation.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,13 @@ jobs:
131131
xvfb-run pytest tests/test_telecom_gp_tc.py --headed --html=report/report.html --self-contained-html
132132
elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then
133133
xvfb-run pytest tests/test_telecom_gp_tc.py tests/test_telecom_smoke_tc.py --headed --html=report/report.html --self-contained-html
134-
else
135-
echo "ERROR: Unknown test suite '${{ env.test_suite }}'"
136-
exit 1
137134
fi
138135
elif [ "${{ env.azure_env_use_case }}" == "IT_helpdesk" ]; then
139136
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
140137
xvfb-run pytest tests/test_ithelpdesk_gp_tc.py --headed --html=report/report.html --self-contained-html
141138
elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then
142139
xvfb-run pytest tests/test_ithelpdesk_gp_tc.py tests/test_ithelpdesk_smoke_tc.py --headed --html=report/report.html --self-contained-html
143-
else
144-
echo "ERROR: Unknown test suite '${{ env.test_suite }}'"
145-
exit 1
146140
fi
147-
else
148-
echo "ERROR: Unknown use case '${{ env.azure_env_use_case }}'. Expected 'telecom' or 'IT_helpdesk'"
149-
exit 1
150141
fi
151142
working-directory: tests/e2e-test
152143
continue-on-error: true
@@ -165,22 +156,13 @@ jobs:
165156
xvfb-run pytest tests/test_telecom_gp_tc.py --headed --html=report/report.html --self-contained-html
166157
elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then
167158
xvfb-run pytest tests/test_telecom_gp_tc.py tests/test_telecom_smoke_tc.py --headed --html=report/report.html --self-contained-html
168-
else
169-
echo "ERROR: Unknown test suite '${{ env.test_suite }}'"
170-
exit 1
171159
fi
172160
elif [ "${{ env.azure_env_use_case }}" == "IT_helpdesk" ]; then
173161
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
174162
xvfb-run pytest tests/test_ithelpdesk_gp_tc.py --headed --html=report/report.html --self-contained-html
175163
elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then
176164
xvfb-run pytest tests/test_ithelpdesk_gp_tc.py tests/test_ithelpdesk_smoke_tc.py --headed --html=report/report.html --self-contained-html
177-
else
178-
echo "ERROR: Unknown test suite '${{ env.test_suite }}'"
179-
exit 1
180165
fi
181-
else
182-
echo "ERROR: Unknown use case '${{ env.azure_env_use_case }}'. Expected 'telecom' or 'IT_helpdesk'"
183-
exit 1
184166
fi
185167
working-directory: tests/e2e-test
186168
continue-on-error: true
@@ -199,22 +181,13 @@ jobs:
199181
xvfb-run pytest tests/test_telecom_gp_tc.py --headed --html=report/report.html --self-contained-html
200182
elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then
201183
xvfb-run pytest tests/test_telecom_gp_tc.py tests/test_telecom_smoke_tc.py --headed --html=report/report.html --self-contained-html
202-
else
203-
echo "ERROR: Unknown test suite '${{ env.test_suite }}'"
204-
exit 1
205184
fi
206185
elif [ "${{ env.azure_env_use_case }}" == "IT_helpdesk" ]; then
207186
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
208187
xvfb-run pytest tests/test_ithelpdesk_gp_tc.py --headed --html=report/report.html --self-contained-html
209188
elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then
210189
xvfb-run pytest tests/test_ithelpdesk_gp_tc.py tests/test_ithelpdesk_smoke_tc.py --headed --html=report/report.html --self-contained-html
211-
else
212-
echo "ERROR: Unknown test suite '${{ env.test_suite }}'"
213-
exit 1
214190
fi
215-
else
216-
echo "ERROR: Unknown use case '${{ env.azure_env_use_case }}'. Expected 'telecom' or 'IT_helpdesk'"
217-
exit 1
218191
fi
219192
working-directory: tests/e2e-test
220193

infra/scripts/copy_kb_files.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,17 @@ if [ "$account_type" == "user" ]; then
6565
elif [ "$account_type" == "servicePrincipal" ]; then
6666
# Running as a service principal - get SP object ID
6767
client_id=$(az account show --query user.name --output tsv 2>/dev/null)
68-
if [ -n "$client_id" ]; then
69-
signed_user_id=$(az ad sp show --id "$client_id" --query id --output tsv 2>/dev/null)
68+
if [ -z "$client_id" ]; then
69+
echo "✗ Failed to get service principal client ID"
70+
exit 1
7071
fi
71-
if [ -z "$signed_user_id" ]; then
72-
echo "✗ Failed to get service principal object ID"
72+
sp_show_output=$(az ad sp show --id "$client_id" --query id --output tsv 2>&1)
73+
if [ $? -ne 0 ] || [ -z "$sp_show_output" ]; then
74+
echo "✗ Failed to get service principal object ID using client ID '$client_id'. Azure CLI output:"
75+
echo "$sp_show_output"
7376
exit 1
7477
fi
78+
signed_user_id="$sp_show_output"
7579
echo "✓ Running as service principal: $signed_user_id"
7680
else
7781
echo "✗ Unknown account type: $account_type"

infra/scripts/fabric_scripts/run_fabric_items_scripts.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@ elif [ "$account_type" == "servicePrincipal" ]; then
2727
# Running as a service principal - get SP object ID
2828
client_id=$(az account show --query user.name --output tsv 2>/dev/null)
2929
if [ -n "$client_id" ]; then
30-
signed_user_id=$(az ad sp show --id "$client_id" --query id --output tsv 2>/dev/null)
31-
fi
32-
if [ -z "$signed_user_id" ]; then
33-
echo "✗ Failed to get service principal object ID"
30+
signed_user_id=$(az ad sp show --id "$client_id" --query id --output tsv 2>&1)
31+
# Check if the command failed or returned an empty/erroneous ID
32+
if [ $? -ne 0 ] || [ -z "$signed_user_id" ] || [[ "$signed_user_id" == *"ERROR"* ]]; then
33+
echo "✗ Failed to get service principal object ID using client ID: $client_id"
34+
echo "Azure CLI output:"
35+
echo "$signed_user_id"
36+
exit 1
37+
fi
38+
else
39+
echo "✗ Failed to get service principal client ID"
3440
exit 1
3541
fi
3642
echo "✓ Running as service principal: $signed_user_id"

infra/scripts/run_create_index_scripts.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ elif [ "$account_type" == "servicePrincipal" ]; then
5353
# Running as a service principal - get SP object ID and display name
5454
client_id=$(az account show --query user.name --output tsv 2>/dev/null)
5555
if [ -n "$client_id" ]; then
56-
sp_info=$(az ad sp show --id "$client_id" --query "{id:id, displayName:displayName}" -o json 2>/dev/null)
56+
sp_info=$(az ad sp show --id "$client_id" --query "{id:id, displayName:displayName}" -o json 2>&1)
57+
if [ $? -ne 0 ]; then
58+
echo "✗ Failed to retrieve service principal information for client ID: $client_id"
59+
echo "$sp_info"
60+
exit 1
61+
fi
5762
signed_user_id=$(echo "$sp_info" | grep -o '"id": *"[^"]*"' | head -1 | sed 's/"id": *"\([^"]*\)"/\1/')
5863
signed_user_display_name=$(echo "$sp_info" | grep -o '"displayName": *"[^"]*"' | sed 's/"displayName": *"\([^"]*\)"/\1/')
5964
fi

0 commit comments

Comments
 (0)