Skip to content

Commit a31d73a

Browse files
feat: Add a2a-tck runs to CI for PRs (GH-152) (#162)
# Description Added the [a2a-tck](https://github.com/maeste/a2a-tck) test to the GitHub Actions workflow of the `a2a-java` project. Tested locally using the following commands. ``` act -P ubuntu-latest=quay.io/jamezp/act-maven -W '.github/workflows/tck-test.yml' ``` Fixes #152 🦕 --------- Signed-off-by: jonghoonpark <[email protected]> Co-authored-by: Kabir Khan <[email protected]>
1 parent f2dae4e commit a31d73a

File tree

2 files changed

+95
-1
lines changed

2 files changed

+95
-1
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
java-version: '17'
2222
distribution: 'temurin'
2323
cache: maven
24-
- name: Build with Maven
24+
- name: Build with Maven and run tests
2525
run: mvn -B package --file pom.xml -fae

.github/workflows/run-tck.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Run TCK
2+
3+
on:
4+
# Handle all branches for now
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
env:
13+
# Tag of the TCK
14+
TCK_VERSION: 0.2.3
15+
# Tells uv to not need a venv, and instead use system
16+
UV_SYSTEM_PYTHON: 1
17+
18+
# Only run the latest job
19+
concurrency:
20+
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
21+
cancel-in-progress: true
22+
23+
jobs:
24+
tck-test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout a2a-java
28+
uses: actions/checkout@v4
29+
- name: Checkout a2a-tck
30+
uses: actions/checkout@v4
31+
with:
32+
repository: maeste/a2a-tck
33+
path: tck/a2a-tck
34+
ref: ${{ env.TCK_VERSION }}
35+
- name: Set up JDK 17
36+
uses: actions/setup-java@v4
37+
with:
38+
java-version: '17'
39+
distribution: 'temurin'
40+
cache: maven
41+
- name: check java_home
42+
run: echo $JAVA_HOME
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version-file: "tck/a2a-tck/pyproject.toml"
47+
- name: Install uv and Python dependencies
48+
run: |
49+
pip install uv
50+
uv pip install -e .
51+
working-directory: tck/a2a-tck
52+
- name: Build with Maven, skipping tests
53+
run: mvn -B install -DskipTests
54+
- name: Start SUT
55+
run: mvn -B quarkus:dev &
56+
working-directory: tck
57+
- name: Wait for SUT to start
58+
run: |
59+
URL="http://localhost:9999/.well-known/agent.json"
60+
EXPECTED_STATUS=200
61+
TIMEOUT=120
62+
RETRY_INTERVAL=2
63+
START_TIME=$(date +%s)
64+
65+
while true; do
66+
# Calculate elapsed time
67+
CURRENT_TIME=$(date +%s)
68+
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
69+
70+
# Check for timeout
71+
if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then
72+
echo "❌ Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds."
73+
exit 1
74+
fi
75+
76+
# Get HTTP status code. || true is to reporting a failure to connect as an error
77+
HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true
78+
echo "STATUS: ${HTTP_STATUS}"
79+
80+
# Check if we got the correct status code
81+
if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then
82+
echo "✅ Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds."
83+
break;
84+
fi
85+
86+
# Wait before retrying
87+
echo "⏳ Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..."
88+
sleep "$RETRY_INTERVAL"
89+
done
90+
91+
- name: Run TCK
92+
run: |
93+
./run_tck.py --sut-url http://localhost:9999 --category all --compliance-report report.json
94+
working-directory: tck/a2a-tck

0 commit comments

Comments
 (0)