From b6b2cec4d54a197f72497cc440dcbc3c047cb0c0 Mon Sep 17 00:00:00 2001 From: Max Ekman Date: Sun, 22 Mar 2026 17:58:43 +0100 Subject: [PATCH 1/2] fix(test): use anonymous process names in async test modules --- test/a2a/plug/auth_test.exs | 2 +- test/a2a/plug/sse_test.exs | 2 +- test/a2a/plug_test.exs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/a2a/plug/auth_test.exs b/test/a2a/plug/auth_test.exs index 673f4c9..604cced 100644 --- a/test/a2a/plug/auth_test.exs +++ b/test/a2a/plug/auth_test.exs @@ -386,7 +386,7 @@ defmodule A2A.Plug.AuthTest do describe "integration with A2A.Plug" do test "auth identity flows to task metadata" do - agent = start_supervised!(A2A.Test.EchoAgent) + agent = start_supervised!({A2A.Test.EchoAgent, [name: nil]}) auth_opts = Auth.init( diff --git a/test/a2a/plug/sse_test.exs b/test/a2a/plug/sse_test.exs index e04be3f..faeebda 100644 --- a/test/a2a/plug/sse_test.exs +++ b/test/a2a/plug/sse_test.exs @@ -42,7 +42,7 @@ defmodule A2A.Plug.SSETest do end setup do - agent = start_supervised!(A2A.Test.StreamAgent) + agent = start_supervised!({A2A.Test.StreamAgent, [name: nil]}) {:ok, agent: agent} end diff --git a/test/a2a/plug_test.exs b/test/a2a/plug_test.exs index 7a98bfb..842db78 100644 --- a/test/a2a/plug_test.exs +++ b/test/a2a/plug_test.exs @@ -35,7 +35,7 @@ defmodule A2A.PlugTest do end setup do - agent = start_supervised!(A2A.Test.EchoAgent) + agent = start_supervised!({A2A.Test.EchoAgent, [name: nil]}) {:ok, agent: agent} end From 7caf8884be21ce6b716b9950fec17d5d61e8763a Mon Sep 17 00:00:00 2001 From: Max Ekman Date: Sun, 22 Mar 2026 18:42:00 +0100 Subject: [PATCH 2/2] ci: use separate workflow for TCK comment post --- .github/workflows/ci.yml | 52 ++++++-------------- .github/workflows/tck-comment.yml | 80 +++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/tck-comment.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c21490..101830e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ on: permissions: contents: read - pull-requests: write jobs: quality: @@ -138,48 +137,25 @@ jobs: - run: mix compile - name: Run TCK (all categories) + id: tck-run run: bin/tck all 2>&1 | tee tck-output.txt - - name: Post TCK results to PR + - name: Save PR metadata for comment workflow if: always() && github.event_name == 'pull_request' - env: - GH_TOKEN: ${{ github.token }} run: | - if [ ! -f tck-output.txt ]; then - echo "No TCK output to post" - exit 0 - fi - - SUMMARY=$(sed -n '/COMPREHENSIVE TEST RESULTS SUMMARY/,/^={10,}/p' tck-output.txt | head -30) - - if [ -z "$SUMMARY" ]; then - echo "No summary section found in TCK output" - exit 0 - fi - - MARKER="" - PR_NUMBER=${{ github.event.pull_request.number }} - - { - echo "${MARKER}" - echo "## TCK Compliance Results" - echo "" - echo '```' - echo "$SUMMARY" - echo '```' - } > tck-comment.md + echo "${{ github.event.pull_request.number }}" > pr-number.txt + echo "${{ steps.tck-run.outcome }}" > tck-outcome.txt - BODY=$(cat tck-comment.md) - - COMMENT_ID=$(gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \ - --jq "[.[] | select(.body | contains(\"${MARKER}\")) | .id] | first" 2>/dev/null || true) - - if [ -n "$COMMENT_ID" ] && [ "$COMMENT_ID" != "null" ]; then - gh api "repos/${{ github.repository }}/issues/comments/${COMMENT_ID}" \ - -X PATCH -f body="$BODY" - else - gh pr comment "$PR_NUMBER" --body-file tck-comment.md - fi + - name: Upload TCK results for PR comment + if: always() && github.event_name == 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: tck-results + path: | + tck-output.txt + pr-number.txt + tck-outcome.txt + retention-days: 1 publish: name: Publish to Hex diff --git a/.github/workflows/tck-comment.yml b/.github/workflows/tck-comment.yml new file mode 100644 index 0000000..0355b71 --- /dev/null +++ b/.github/workflows/tck-comment.yml @@ -0,0 +1,80 @@ +name: TCK PR Comment + +on: + workflow_run: + workflows: ["CI"] + types: [completed] + +permissions: + pull-requests: write + +jobs: + comment: + name: Post TCK results to PR + runs-on: ubuntu-24.04 + if: >- + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion != 'cancelled' + steps: + - name: Download TCK results artifact + uses: actions/download-artifact@v4 + with: + name: tck-results + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + continue-on-error: true + id: download + + - name: Post TCK results comment + if: steps.download.outcome == 'success' + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + if [ ! -f tck-output.txt ]; then + echo "No TCK output file found" + exit 0 + fi + + if [ ! -f pr-number.txt ]; then + echo "No PR number file found" + exit 0 + fi + + PR_NUMBER=$(cat pr-number.txt) + if [ -z "$PR_NUMBER" ]; then + echo "PR number is empty" + exit 0 + fi + + SUMMARY=$(sed -n '/COMPREHENSIVE TEST RESULTS SUMMARY/,/^={10,}/p' tck-output.txt | head -30) + + if [ -z "$SUMMARY" ]; then + echo "No summary section found in TCK output" + exit 0 + fi + + MARKER="" + + { + echo "${MARKER}" + echo "## TCK Compliance Results" + echo "" + echo '```' + echo "$SUMMARY" + echo '```' + } > tck-comment.md + + BODY=$(cat tck-comment.md) + + COMMENT_ID=$(gh api "repos/${GH_REPO}/issues/${PR_NUMBER}/comments" \ + --jq "[.[] | select(.body | contains(\"${MARKER}\")) | .id] | first" 2>/dev/null || true) + + if [ -n "$COMMENT_ID" ] && [ "$COMMENT_ID" != "null" ]; then + gh api "repos/${GH_REPO}/issues/comments/${COMMENT_ID}" \ + -X PATCH -f body="$BODY" + echo "Updated existing comment ${COMMENT_ID}" + else + gh pr comment "$PR_NUMBER" --body-file tck-comment.md + echo "Created new comment" + fi