Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/run-tck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and Run TCK

on:
push:
branches:
# - main
pull_request:
branches:
# - main


env:
# Tag of the TCK
TCK_VERSION: v0.2.3
# Tells uv to not need a venv, and instead use system
UV_SYSTEM_PYTHON: 1


# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
build-and-test:
name: Run TCK
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Checkout a2a-java
uses: actions/checkout@v4
with:
repository: a2aproject/a2a-java
path: a2a-java
- name: Checkout a2a-tck
uses: actions/checkout@v4
with:
repository: a2aproject/a2a-tck
path: a2a-tck
ref: ${{ env.TCK_VERSION }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build a2a-java with Maven, skipping tests
run: |
mvn -B install -DskipTests
working-directory: a2a-java
- name: Get a2a-java version and save as env var
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "SDK_VERSION=${VERSION}" >> "$GITHUB_ENV"
working-directory: a2a-java
- name: Build the TCK server
run: |
mvn clean install -B -Dversion.sdk=${SDK_VERSION} -pl tck -am
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "a2a-tck/pyproject.toml"
- name: Install uv and Python dependencies
run: |
pip install uv
uv pip install -e .
working-directory: a2a-tck
- name: Start the WildFly SUT
run: |
mvn wildfly:start -B -pl tck -Dstartup-timeout=120
- name: Run TCK
run: |
./run_tck.py --sut-url http://localhost:8080 --category all --compliance-report report.json
working-directory: a2a-tck
- name: Start the WildFly SUT
run: |
mvn wildfly:shutdown


41 changes: 1 addition & 40 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,51 +178,11 @@
<groupId>org.wildfly.glow</groupId>
<artifactId>wildfly-glow-arquillian-plugin</artifactId>
<version>1.4.1.Final</version>
<configuration>
<feature-packs>
<feature-pack>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-galleon-pack</artifactId>
<version>${version.wildfly}</version>
</feature-pack>
</feature-packs>
<config-name>standalone.xml</config-name>
</configuration>
<executions>
<execution>
<id>scan</id>
<goals>
<goal>scan</goal>
</goals>
<phase>test-compile</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>5.1.3.Final</version>
<configuration>
<provisioning-file>${project.build.directory}/glow-scan/provisioning.xml</provisioning-file>
<jboss-home>${jboss.home}</jboss-home>
<provisioning-dir>${jboss.home}</provisioning-dir>
<packagingScripts>
<packaging-script>
<scripts>
<script>./src/scripts/configure_logger.cli</script>
</scripts>
</packaging-script>
</packagingScripts>
</configuration>
<executions>
<execution>
<id>test-provisioning</id>
<goals>
<goal>package</goal>
</goals>
<phase>test-compile</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -286,6 +246,7 @@
<modules>
<module>impl</module>
<module>wildfly-jar</module>
<module>tck</module>
<module>tests/common</module>
<module>tests/impl</module>
<module>tests/wildfly-jar</module>
Expand Down
84 changes: 84 additions & 0 deletions tck/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta-tck-wildfly</artifactId>

<packaging>war</packaging>

<name>WildFly Extras - Java A2A SDK for Jakarta - TCK - WildFly Jar</name>
<description>Java SDK for the Agent2Agent Protocol (A2A) - SDK - Jakarta - TCK - WildFly Jar</description>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-server-jakarta-wildfly</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-sdk-spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<discover-provisioning-info>
</discover-provisioning-info>
<jboss-home>${jboss.home}</jboss-home>
<name>ROOT.war</name>
<provisioning-dir>${jboss.home}</provisioning-dir>
<packagingScripts>
<packaging-script>
<scripts>
<script>./src/scripts/configure_logger.cli</script>
</scripts>
</packaging-script>
</packagingScripts>
</configuration>
<executions>
<execution>
<id>provisioning</id>
<goals>
<goal>package</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.wildfly.extras.a2a.server.jakarta.tck;

import java.util.Collections;
import java.util.List;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;

import io.a2a.server.PublicAgentCard;
import io.a2a.spec.AgentCapabilities;
import io.a2a.spec.AgentCard;
import io.a2a.spec.AgentSkill;

/**
* This is a copy of the AgentCardProducer from the a2a-java SDK's tck/ module
*/
@ApplicationScoped
public class AgentCardProducer {

@Produces
@PublicAgentCard
public AgentCard agentCard() {
return new AgentCard.Builder()
.name("Hello World Agent")
.description("Just a hello world agent")
.url("http://localhost:9999")
.version("1.0.0")
.documentationUrl("http://example.com/docs")
.capabilities(new AgentCapabilities.Builder()
.streaming(true)
.pushNotifications(true)
.stateTransitionHistory(true)
.build())
.defaultInputModes(Collections.singletonList("text"))
.defaultOutputModes(Collections.singletonList("text"))
.skills(Collections.singletonList(new AgentSkill.Builder()
.id("hello_world")
.name("Returns hello world")
.description("just returns hello world")
.tags(Collections.singletonList("hello world"))
.examples(List.of("hi", "hello world"))
.build()))
.build();
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package org.wildfly.extras.a2a.server.jakarta.tck;

import jakarta.annotation.PreDestroy;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;

import io.a2a.server.agentexecution.AgentExecutor;
import io.a2a.server.agentexecution.RequestContext;
import io.a2a.server.events.EventQueue;
import io.a2a.server.tasks.TaskUpdater;
import io.a2a.spec.JSONRPCError;
import io.a2a.spec.Task;
import io.a2a.spec.TaskNotCancelableError;
import io.a2a.spec.TaskNotFoundError;
import io.a2a.spec.TaskState;
import io.a2a.spec.TaskStatus;
import io.a2a.spec.TaskStatusUpdateEvent;

/**
* This is a copy of the AgentExecutorProducer from the a2a-java SDK's tck/ module
*/
@ApplicationScoped
public class AgentExecutorProducer {

@Produces
public AgentExecutor agentExecutor() {
return new FireAndForgetAgentExecutor();
}

private static class FireAndForgetAgentExecutor implements AgentExecutor {
@Override
public void execute(RequestContext context, EventQueue eventQueue) throws JSONRPCError {
Task task = context.getTask();

if (context.getMessage().getTaskId() != null && task == null && context.getMessage().getTaskId().startsWith("non-existent")) {
throw new TaskNotFoundError();
}

if (task == null) {
task = new Task.Builder()
.id(context.getTaskId())
.contextId(context.getContextId())
.status(new TaskStatus(TaskState.SUBMITTED))
.history(context.getMessage())
.build();
eventQueue.enqueueEvent(task);
}

TaskUpdater updater = new TaskUpdater(context, eventQueue);

// Immediately set to WORKING state
updater.startWork();
System.out.println("====> task set to WORKING, starting background execution");

// Method returns immediately - task continues in background
System.out.println("====> execute() method returning immediately, task running in background");
}

@Override
public void cancel(RequestContext context, EventQueue eventQueue) throws JSONRPCError {
System.out.println("====> task cancel request received");
Task task = context.getTask();

if (task.getStatus().state() == TaskState.CANCELED) {
System.out.println("====> task already canceled");
throw new TaskNotCancelableError();
}

if (task.getStatus().state() == TaskState.COMPLETED) {
System.out.println("====> task already completed");
throw new TaskNotCancelableError();
}

TaskUpdater updater = new TaskUpdater(context, eventQueue);
updater.cancel();
eventQueue.enqueueEvent(new TaskStatusUpdateEvent.Builder()
.taskId(task.getId())
.contextId(task.getContextId())
.status(new TaskStatus(TaskState.CANCELED))
.isFinal(true)
.build());

System.out.println("====> task canceled");
}

/**
* Cleanup method for proper resource management
*/
@PreDestroy
public void cleanup() {
System.out.println("====> shutting down task executor");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.wildfly.extras.a2a.server.jakarta.tck;

import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/")
public class RestApplication extends Application {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
bean-discovery-mode="all">
bean-discovery-mode="annotated">
</beans>
2 changes: 2 additions & 0 deletions tck/src/scripts/configure_logger.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/subsystem=logging/logger=org.jboss.weld:add(level=DEBUG)
/subsystem=logging/logger=io.a2a:add(level=DEBUG)
Loading