From 55e95b9bbd08fbd1b31f6e3bf11ebe78d7a34fbf Mon Sep 17 00:00:00 2001 From: Pradeep Sekar Date: Sun, 25 Jan 2026 08:31:50 -0800 Subject: [PATCH] Make test results to job summary --- .github/workflows/test-race.yml | 24 +++++++++++++++++++++++- .github/workflows/test.yml | 25 ++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-race.yml b/.github/workflows/test-race.yml index b1704e8fe1..2bc8a5101b 100644 --- a/.github/workflows/test-race.yml +++ b/.github/workflows/test-race.yml @@ -174,6 +174,7 @@ jobs: until pg_isready -h 127.0.0.1; do docker container inspect boundary-sql-tests &> /dev/null || exit 255; sleep 1; done - name: Test + id: test uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 env: TEST_PACKAGE: "./..." @@ -183,7 +184,28 @@ jobs: max_attempts: 1 timeout_minutes: 120 retry_on: error - command: make test + command: make test 2>&1 | tee test-output.log + - name: Generate Test Summary + if: always() + run: | + echo "## ๐Ÿงช Race Test Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + if [ "${{ steps.test.outcome }}" == "success" ]; then + echo "โœ… **All race tests passed!**" >> $GITHUB_STEP_SUMMARY + else + echo "โŒ **Race tests failed!**" >> $GITHUB_STEP_SUMMARY + fi + echo "" >> $GITHUB_STEP_SUMMARY + + if [ -f test-output.log ]; then + echo "### Test Summary Table" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sed -n '/โ”‚.*STATUS.*PACKAGE.*PASS.*FAIL/,/^[0-9].*โ””/p' test-output.log >> $GITHUB_STEP_SUMMARY || \ + echo "Test summary table not available" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + fi + echo "**Workflow Run:** [View Details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY - name: Cleanup if: always() run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfb35df974..ba04c629f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -174,6 +174,7 @@ jobs: until pg_isready -h 127.0.0.1; do docker container inspect boundary-sql-tests &> /dev/null || exit 255; sleep 1; done - name: Test + id: test uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 env: TEST_PACKAGE: "./..." @@ -183,7 +184,29 @@ jobs: max_attempts: 1 timeout_minutes: 120 retry_on: error - command: make test + command: make test 2>&1 | tee test-output.log + - name: Generate Test Summary + if: always() + run: | + echo "## ๐Ÿงช Test Results" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + if [ "${{ steps.test.outcome }}" == "success" ]; then + echo "โœ… **All tests passed!**" >> $GITHUB_STEP_SUMMARY + else + echo "โŒ **Tests failed!**" >> $GITHUB_STEP_SUMMARY + fi + echo "" >> $GITHUB_STEP_SUMMARY + + if [ -f test-output.log ]; then + echo "### Test Summary Table" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + sed -n '/โ”‚.*STATUS.*PACKAGE.*PASS.*FAIL/,/^[0-9].*โ””/p' test-output.log >> $GITHUB_STEP_SUMMARY || \ + echo "Test summary table not available" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + fi + + echo "**Workflow Run:** [View Details](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY - name: Cleanup if: always() run: |