|
| 1 | +name: Run TCK 1.0 (WIP) |
| 2 | + |
| 3 | +on: |
| 4 | + # Handle all branches for now |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +env: |
| 14 | + # TODO this is currently running the TCK off the main branch which included changes needed for 0.4.0 |
| 15 | + # Tag/branch of the TCK |
| 16 | + TCK_VERSION: spec_1.0 |
| 17 | + # Tell the TCK runner to report failure if the quality tests fail |
| 18 | + A2A_TCK_FAIL_ON_QUALITY: 1 |
| 19 | + # Tell the TCK runner to report failure if the features tests fail |
| 20 | + A2A_TCK_FAIL_ON_FEATURES: 1 |
| 21 | + # Tells uv to not need a venv, and instead use system |
| 22 | + UV_SYSTEM_PYTHON: 1 |
| 23 | + # SUT_JSONRPC_URL to use for the TCK and the server agent |
| 24 | + SUT_JSONRPC_URL: http://localhost:9999 |
| 25 | + # Slow system on CI |
| 26 | + TCK_STREAMING_TIMEOUT: 5.0 |
| 27 | + |
| 28 | +# Only run the latest job |
| 29 | +concurrency: |
| 30 | + group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}' |
| 31 | + cancel-in-progress: true |
| 32 | + |
| 33 | +jobs: |
| 34 | + tck-test: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + java-version: [17, 21, 25] |
| 39 | + steps: |
| 40 | + - name: Checkout a2a-java |
| 41 | + uses: actions/checkout@v4 |
| 42 | + - name: Checkout a2a-tck |
| 43 | + uses: actions/checkout@v4 |
| 44 | + with: |
| 45 | + repository: jmesnil/a2a-tck |
| 46 | + path: tck/a2a-tck |
| 47 | + ref: ${{ env.TCK_VERSION }} |
| 48 | + - name: Set up JDK ${{ matrix.java-version }} |
| 49 | + uses: actions/setup-java@v5 |
| 50 | + with: |
| 51 | + java-version: ${{ matrix.java-version }} |
| 52 | + distribution: 'temurin' |
| 53 | + cache: maven |
| 54 | + - name: check java_home |
| 55 | + run: echo $JAVA_HOME |
| 56 | + - name: Set up Python |
| 57 | + uses: actions/setup-python@v5 |
| 58 | + with: |
| 59 | + python-version-file: "tck/a2a-tck/pyproject.toml" |
| 60 | + - name: Install uv and Python dependencies |
| 61 | + run: | |
| 62 | + pip install uv |
| 63 | + uv pip install -e . |
| 64 | + working-directory: tck/a2a-tck |
| 65 | + - name: Build with Maven, skipping tests |
| 66 | + run: mvn -B install -DskipTests |
| 67 | + - name: Start SUT |
| 68 | + run: SUT_GRPC_URL=${{ env.SUT_JSONRPC_URL }} SUT_REST_URL=${{ env.SUT_JSONRPC_URL }} mvn -B quarkus:dev & #SUT_JSONRPC_URL already set |
| 69 | + working-directory: tck |
| 70 | + - name: Wait for SUT to start |
| 71 | + run: | |
| 72 | + URL="${{ env.SUT_JSONRPC_URL }}/.well-known/agent-card.json" |
| 73 | + EXPECTED_STATUS=200 |
| 74 | + TIMEOUT=120 |
| 75 | + RETRY_INTERVAL=2 |
| 76 | + START_TIME=$(date +%s) |
| 77 | +
|
| 78 | + while true; do |
| 79 | + # Calculate elapsed time |
| 80 | + CURRENT_TIME=$(date +%s) |
| 81 | + ELAPSED_TIME=$((CURRENT_TIME - START_TIME)) |
| 82 | +
|
| 83 | + # Check for timeout |
| 84 | + if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then |
| 85 | + echo "❌ Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds." |
| 86 | + exit 1 |
| 87 | + fi |
| 88 | +
|
| 89 | + # Get HTTP status code. || true is to reporting a failure to connect as an error |
| 90 | + HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true |
| 91 | + echo "STATUS: ${HTTP_STATUS}" |
| 92 | +
|
| 93 | + # Check if we got the correct status code |
| 94 | + if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then |
| 95 | + echo "✅ Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds." |
| 96 | + break; |
| 97 | + fi |
| 98 | +
|
| 99 | + # Wait before retrying |
| 100 | + echo "⏳ Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..." |
| 101 | + sleep "$RETRY_INTERVAL" |
| 102 | + done |
| 103 | + |
| 104 | + - name: Run TCK |
| 105 | + id: run-tck |
| 106 | + timeout-minutes: 5 |
| 107 | + run: | |
| 108 | + ./run_tck.py --sut-url ${{ env.SUT_JSONRPC_URL }} --category all --transports jsonrpc,grpc,rest --compliance-report report.json 2>&1 | tee tck-output.log |
| 109 | + working-directory: tck/a2a-tck |
| 110 | + - name: Capture Diagnostics on Failure |
| 111 | + if: failure() |
| 112 | + run: | |
| 113 | + echo "=== Capturing diagnostic information ===" |
| 114 | +
|
| 115 | + # Create diagnostics directory |
| 116 | + mkdir -p tck/target/diagnostics |
| 117 | +
|
| 118 | + # Capture process list |
| 119 | + echo "📋 Capturing process list..." |
| 120 | + ps auxww > tck/target/diagnostics/processes.txt |
| 121 | +
|
| 122 | + # Find the actual Quarkus JVM (child of Maven process), not the Maven parent |
| 123 | + # Look for the dev.jar process which is the actual application |
| 124 | + QUARKUS_PID=$(pgrep -f "a2a-tck-server-dev.jar" || echo "") |
| 125 | + if [ -n "$QUARKUS_PID" ]; then |
| 126 | + echo "📊 Capturing thread dump for Quarkus JVM PID $QUARKUS_PID" |
| 127 | + jstack $QUARKUS_PID > tck/target/diagnostics/thread-dump.txt || echo "Failed to capture thread dump" |
| 128 | + if [ -f tck/target/diagnostics/thread-dump.txt ]; then |
| 129 | + echo "✅ Thread dump captured ($(wc -l < tck/target/diagnostics/thread-dump.txt) lines)" |
| 130 | + fi |
| 131 | + else |
| 132 | + echo "⚠️ No Quarkus JVM process found for thread dump" |
| 133 | + echo "Available Java processes:" |
| 134 | + ps aux | grep java | tee -a tck/target/diagnostics/processes.txt || true |
| 135 | + fi |
| 136 | +
|
| 137 | + # Capture Quarkus application logs (if available) |
| 138 | + echo "📝 Checking for Quarkus logs..." |
| 139 | + if [ -f tck/target/quarkus.log ]; then |
| 140 | + cp tck/target/quarkus.log tck/target/diagnostics/ |
| 141 | + echo "✅ Copied quarkus.log ($(wc -l < tck/target/quarkus.log) lines)" |
| 142 | + fi |
| 143 | +
|
| 144 | + # Copy TCK server logs |
| 145 | + if [ -f tck/target/tck-test.log ]; then |
| 146 | + cp tck/target/tck-test.log tck/target/diagnostics/ |
| 147 | + echo "✅ Copied tck-test.log ($(wc -l < tck/target/tck-test.log) lines)" |
| 148 | + fi |
| 149 | +
|
| 150 | + echo "" |
| 151 | + echo "=== Diagnostic capture complete ===" |
| 152 | + - name: Stop Quarkus Server |
| 153 | + if: always() |
| 154 | + run: | |
| 155 | + # Find and kill the Quarkus process to ensure logs are flushed |
| 156 | + pkill -f "quarkus:dev" || true |
| 157 | + sleep 2 |
| 158 | + - name: Upload TCK Diagnostics |
| 159 | + if: failure() |
| 160 | + uses: actions/upload-artifact@v4 |
| 161 | + with: |
| 162 | + name: tck-diagnostics-java-${{ matrix.java-version }} |
| 163 | + path: | |
| 164 | + tck/target/diagnostics/ |
| 165 | + tck/a2a-tck/tck-output.log |
| 166 | + retention-days: 7 |
| 167 | + if-no-files-found: warn |
| 168 | + - name: Upload TCK Compliance Report |
| 169 | + if: always() |
| 170 | + uses: actions/upload-artifact@v4 |
| 171 | + with: |
| 172 | + name: tck-compliance-report-java-${{ matrix.java-version }} |
| 173 | + path: tck/a2a-tck/report.json |
| 174 | + retention-days: 14 |
| 175 | + if-no-files-found: ignore |
0 commit comments