Skip to content

Commit e97a503

Browse files
committed
fix: Make the JSONRPC and GRPC URLs used for TCK testing configurable
1 parent 26ab76d commit e97a503

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/run-tck.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ env:
1515
TCK_VERSION: 0.3.0.alpha
1616
# Tells uv to not need a venv, and instead use system
1717
UV_SYSTEM_PYTHON: 1
18+
# SUT_JSONRPC_URL to use for the TCK
19+
SUT_JSONRPC_URL: http://localhost:9999
20+
# SUT_GRPC_URL to use for the TCK
21+
SUT_GRPC_URL: http://localhost:9000
1822

1923
# Only run the latest job
2024
concurrency:
@@ -57,7 +61,7 @@ jobs:
5761
working-directory: tck
5862
- name: Wait for SUT to start
5963
run: |
60-
URL="http://localhost:9999/.well-known/agent-card.json"
64+
URL="${{ env.SUT_JSONRPC_URL }}/.well-known/agent-card.json"
6165
EXPECTED_STATUS=200
6266
TIMEOUT=120
6367
RETRY_INTERVAL=2
@@ -91,5 +95,5 @@ jobs:
9195
9296
- name: Run TCK
9397
run: |
94-
./run_tck.py --sut-url http://localhost:9999 --category all --compliance-report report.json
98+
./run_tck.py --sut-url ${{ env.SUT_JSONRPC_URL }} --category all --transports jsonrpc,grpc --compliance-report report.json
9599
working-directory: tck/a2a-tck

tck/src/main/java/io/a2a/tck/server/AgentCardProducer.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ public class AgentCardProducer {
2020
@Produces
2121
@PublicAgentCard
2222
public AgentCard agentCard() {
23+
String SUT_JSONRPC_URL = getEnvOrDefault("SUT_JSONRPC_URL", "http://localhost:9999");
24+
String SUT_GRPC_URL = getEnvOrDefault("SUT_GRPC_URL", "http://localhost:9000");
2325
return new AgentCard.Builder()
2426
.name("Hello World Agent")
2527
.description("Just a hello world agent")
26-
.url("http://localhost:9999")
28+
.url(SUT_JSONRPC_URL)
2729
.version("1.0.0")
2830
.documentationUrl("http://example.com/docs")
2931
.capabilities(new AgentCapabilities.Builder()
@@ -42,9 +44,14 @@ public AgentCard agentCard() {
4244
.build()))
4345
.protocolVersion("0.3.0")
4446
.additionalInterfaces(List.of(
45-
new AgentInterface(TransportProtocol.JSONRPC.asString(), "http://localhost:9999"),
46-
new AgentInterface(TransportProtocol.GRPC.asString(), "http://localhost:9000")))
47+
new AgentInterface(TransportProtocol.JSONRPC.asString(), SUT_JSONRPC_URL),
48+
new AgentInterface(TransportProtocol.GRPC.asString(), SUT_GRPC_URL)))
4749
.build();
4850
}
51+
52+
private static String getEnvOrDefault(String envVar, String defaultValue) {
53+
String value = System.getenv(envVar);
54+
return value == null || value.isEmpty() ? defaultValue : value;
55+
}
4956
}
5057

0 commit comments

Comments
 (0)