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
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17, 19]
java: [8, 11, 17, 21, 25]
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand All @@ -17,7 +17,7 @@ jobs:
distribution: "zulu"
cache: "maven"
- name: Build with Maven
run: mvn -V -ntp clean install -P full
run: mvn -V -ntp clean install -P full verify

windows_build:
runs-on: windows-2022
Expand Down
21 changes: 21 additions & 0 deletions arthas-mcp-integration-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# arthas-mcp-integration-test

本模块提供 Arthas MCP Server 的集成测试:

- 测试会启动一个独立的目标 JVM(`TargetJvmApp`)。
- 通过 `packaging/target/arthas-bin/as.sh` 动态 attach 到目标 JVM,在目标 JVM 内启动 Arthas Server(仅开启 HTTP 端口,telnet 端口设置为 0)。
- 使用最小 MCP(Streamable HTTP + SSE)客户端调用 `tools/list``tools/call`,验证 MCP tools 功能可用。

## 运行方式

在项目根目录执行:

```bash
./mvnw -pl arthas-mcp-integration-test -am verify
```

说明:

- `-am` 会确保 `packaging` 等依赖模块先构建,从而在 `packaging/target/arthas-bin` 生成可用的 `as.sh` 与相关 jar。
- 该集成测试依赖本机 `bash`,Windows 环境会自动跳过。

74 changes: 74 additions & 0 deletions arthas-mcp-integration-test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.taobao.arthas</groupId>
<artifactId>arthas-all</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>arthas-mcp-integration-test</artifactId>
<name>arthas-mcp-integration-test</name>
<url>https://github.com/alibaba/arthas</url>

<dependencies>
<dependency>
<groupId>com.taobao.arthas</groupId>
<artifactId>arthas-packaging</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.taobao.arthas</groupId>
<artifactId>arthas-mcp-server</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<executions>
<execution>
<id>it-verify</id>
<phase>verify</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading
Loading