Skip to content

Commit 0a051bb

Browse files
committed
fix: harden integration test result reporting
1 parent 7ae08bf commit 0a051bb

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/run_integration_tests.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ jobs:
5858
private-key: ${{ secrets.app_private_key }}
5959
owner: ${{ github.repository_owner }}
6060

61-
- name: Install yq
62-
run: |
63-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
64-
sudo chmod +x /usr/local/bin/yq
61+
- name: Check yq
62+
run: yq --version
6563

6664
- name: Discover dependent Python services
6765
id: discover
@@ -180,10 +178,17 @@ jobs:
180178
- name: Determine result
181179
id: result
182180
run: |
181+
DISCOVER_RESULT="${{ needs.discover-services.result }}"
183182
TEST_RESULT="${{ needs.test-service.result }}"
184183
COUNT="${{ needs.discover-services.outputs.count }}"
184+
MATRIX='${{ needs.discover-services.outputs.matrix }}'
185+
COUNT="${COUNT:-0}"
186+
MATRIX="${MATRIX:-[]}"
185187
186-
if [ "$TEST_RESULT" = "success" ]; then
188+
if [ "$DISCOVER_RESULT" != "success" ]; then
189+
echo "outcome=fail" >> $GITHUB_OUTPUT
190+
echo "Integration tests FAILED (discovery result: $DISCOVER_RESULT)"
191+
elif [ "$TEST_RESULT" = "success" ]; then
187192
echo "outcome=pass" >> $GITHUB_OUTPUT
188193
echo "Integration tests PASSED ($COUNT services tested)"
189194
elif [ "$TEST_RESULT" = "skipped" ] && [ "$COUNT" = "0" ]; then
@@ -194,6 +199,13 @@ jobs:
194199
echo "Integration tests FAILED (test result: $TEST_RESULT)"
195200
fi
196201
202+
echo "count=$COUNT" >> $GITHUB_OUTPUT
203+
{
204+
echo "matrix<<EOF"
205+
echo "$MATRIX"
206+
echo "EOF"
207+
} >> $GITHUB_OUTPUT
208+
197209
- name: Generate callback token
198210
uses: actions/create-github-app-token@v3.2.0
199211
id: callback-token
@@ -214,5 +226,5 @@ jobs:
214226
"library_name": "${{ inputs.library_name }}",
215227
"library_tag": "${{ inputs.library_tag }}",
216228
"details_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
217-
"services_tested": ${{ needs.discover-services.outputs.matrix }}
229+
"services_tested": ${{ steps.result.outputs.matrix }}
218230
}

0 commit comments

Comments
 (0)