Skip to content

Commit 78abea7

Browse files
authored
arthas-mcp-integration-test (#3115)
1 parent 67fdc80 commit 78abea7

File tree

9 files changed

+1277
-7
lines changed

9 files changed

+1277
-7
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
java: [8, 11, 17, 19]
10+
java: [8, 11, 17, 21, 25]
1111
steps:
1212
- uses: actions/checkout@v3
1313
- name: Setup java
@@ -17,7 +17,7 @@ jobs:
1717
distribution: "zulu"
1818
cache: "maven"
1919
- name: Build with Maven
20-
run: mvn -V -ntp clean install -P full
20+
run: mvn -V -ntp clean install -P full verify
2121

2222
windows_build:
2323
runs-on: windows-2022
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# arthas-mcp-integration-test
2+
3+
本模块提供 Arthas MCP Server 的集成测试:
4+
5+
- 测试会启动一个独立的目标 JVM(`TargetJvmApp`)。
6+
- 通过 `packaging/target/arthas-bin/as.sh` 动态 attach 到目标 JVM,在目标 JVM 内启动 Arthas Server(仅开启 HTTP 端口,telnet 端口设置为 0)。
7+
- 使用最小 MCP(Streamable HTTP + SSE)客户端调用 `tools/list``tools/call`,验证 MCP tools 功能可用。
8+
9+
## 运行方式
10+
11+
在项目根目录执行:
12+
13+
```bash
14+
./mvnw -pl arthas-mcp-integration-test -am verify
15+
```
16+
17+
说明:
18+
19+
- `-am` 会确保 `packaging` 等依赖模块先构建,从而在 `packaging/target/arthas-bin` 生成可用的 `as.sh` 与相关 jar。
20+
- 该集成测试依赖本机 `bash`,Windows 环境会自动跳过。
21+
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>com.taobao.arthas</groupId>
9+
<artifactId>arthas-all</artifactId>
10+
<version>${revision}</version>
11+
<relativePath>../pom.xml</relativePath>
12+
</parent>
13+
14+
<artifactId>arthas-mcp-integration-test</artifactId>
15+
<name>arthas-mcp-integration-test</name>
16+
<url>https://github.com/alibaba/arthas</url>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>com.taobao.arthas</groupId>
21+
<artifactId>arthas-packaging</artifactId>
22+
<version>${project.version}</version>
23+
<scope>test</scope>
24+
</dependency>
25+
26+
<dependency>
27+
<groupId>com.taobao.arthas</groupId>
28+
<artifactId>arthas-mcp-server</artifactId>
29+
<version>${project.version}</version>
30+
<scope>test</scope>
31+
</dependency>
32+
33+
<dependency>
34+
<groupId>org.junit.jupiter</groupId>
35+
<artifactId>junit-jupiter</artifactId>
36+
<scope>test</scope>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.assertj</groupId>
40+
<artifactId>assertj-core</artifactId>
41+
<scope>test</scope>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>io.modelcontextprotocol.sdk</groupId>
46+
<artifactId>mcp</artifactId>
47+
</dependency>
48+
</dependencies>
49+
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-surefire-plugin</artifactId>
55+
<version>3.2.5</version>
56+
<executions>
57+
<execution>
58+
<id>it-verify</id>
59+
<phase>verify</phase>
60+
<goals>
61+
<goal>test</goal>
62+
</goals>
63+
<configuration>
64+
<includes>
65+
<include>**/*IT.java</include>
66+
</includes>
67+
</configuration>
68+
</execution>
69+
</executions>
70+
</plugin>
71+
</plugins>
72+
</build>
73+
74+
</project>

0 commit comments

Comments
 (0)