@mcpmesh/tsuite 0.2.11 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +199 -0
  2. package/package.json +5 -5
package/README.md ADDED
@@ -0,0 +1,199 @@
1
+ # tsuite
2
+
3
+ YAML-driven integration test framework with container isolation and real-time monitoring.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @mcpmesh/tsuite
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # View the quickstart guide
15
+ tsuite man quickstart
16
+
17
+ # Start the dashboard (includes API server)
18
+ tsuite api --port 9999
19
+
20
+ # Open http://localhost:9999 in your browser
21
+ ```
22
+
23
+ ## Commands
24
+
25
+ ### Run Tests
26
+
27
+ ```bash
28
+ # Run all tests in Docker mode
29
+ tsuite run --suite ./my-suite --all --docker
30
+
31
+ # Run specific use case
32
+ tsuite run --suite ./my-suite --uc uc01_registry --docker
33
+
34
+ # Run specific test case
35
+ tsuite run --suite ./my-suite --tc uc01_registry/tc01_agent_registration --docker
36
+
37
+ # Run tests matching tags
38
+ tsuite run --suite ./my-suite --tag smoke --docker
39
+
40
+ # Dry run (list tests without executing)
41
+ tsuite run --suite ./my-suite --dry-run --all
42
+ ```
43
+
44
+ ### Dashboard & API Server
45
+
46
+ ```bash
47
+ # Start on default port (9999)
48
+ tsuite api
49
+
50
+ # Start on custom port
51
+ tsuite api --port 8080
52
+
53
+ # Start in background (detached)
54
+ tsuite api --detach
55
+
56
+ # Stop background server
57
+ tsuite stop
58
+ ```
59
+
60
+ ### Scaffold Test Cases
61
+
62
+ Generate test cases from agent directories:
63
+
64
+ ```bash
65
+ # Interactive mode
66
+ tsuite scaffold --suite ./my-suite ./path/to/agent1 ./path/to/agent2
67
+
68
+ # Non-interactive mode
69
+ tsuite scaffold --suite ./my-suite --uc uc01_tags --tc tc01_test ./agent1 ./agent2
70
+
71
+ # Preview without creating files
72
+ tsuite scaffold --suite ./my-suite --uc uc01_tags --tc tc01_test --dry-run ./agent1
73
+ ```
74
+
75
+ ### Documentation
76
+
77
+ ```bash
78
+ # List available topics
79
+ tsuite man --list
80
+
81
+ # View specific topic
82
+ tsuite man quickstart
83
+ tsuite man handlers
84
+ tsuite man assertions
85
+ tsuite man routines
86
+ ```
87
+
88
+ ### Clear Data
89
+
90
+ ```bash
91
+ # Clear all test data
92
+ tsuite clear --all
93
+
94
+ # Clear specific run
95
+ tsuite clear --run-id <run_id>
96
+ ```
97
+
98
+ ## Features
99
+
100
+ - **YAML-based test definitions** - Tests as configuration, not code
101
+ - **Container isolation** - Each test runs in a fresh Docker container
102
+ - **Parallel execution** - Worker pool for concurrent test runs
103
+ - **Web dashboard** - Real-time monitoring, history, and test editor
104
+ - **Pluggable handlers** - shell, http, file, wait, pip-install, npm-install
105
+ - **Expression language** - Flexible assertions with jq, JSONPath support
106
+ - **Reusable routines** - Define once, use across tests
107
+ - **Scaffold command** - Auto-generate test cases from agent directories
108
+
109
+ ## Test Suite Structure
110
+
111
+ ```
112
+ my-suite/
113
+ ├── config.yaml # Suite configuration
114
+ ├── global/
115
+ │ └── routines.yaml # Global reusable routines
116
+ └── suites/
117
+ └── uc01_example/ # Use case folder
118
+ ├── routines.yaml # UC-level routines (optional)
119
+ └── tc01_test/ # Test case folder
120
+ ├── test.yaml # Test definition
121
+ └── artifacts/ # Test artifacts (agents, fixtures)
122
+ ```
123
+
124
+ ## Example Test
125
+
126
+ ```yaml
127
+ name: "Agent Registration Test"
128
+ description: "Verify agent registers with mesh"
129
+ tags: [smoke, registry]
130
+ timeout: 300
131
+
132
+ pre_run:
133
+ - routine: global.setup_for_python_agent
134
+ params:
135
+ meshctl_version: "${config.packages.cli_version}"
136
+
137
+ test:
138
+ - name: "Copy agent to workspace"
139
+ handler: shell
140
+ command: "cp -r /artifacts/my-agent /workspace/"
141
+
142
+ - name: "Start agent"
143
+ handler: shell
144
+ command: "meshctl start my-agent/main.py -d"
145
+ workdir: /workspace
146
+
147
+ - name: "Wait for registration"
148
+ handler: wait
149
+ seconds: 5
150
+
151
+ - name: "Verify agent registered"
152
+ handler: shell
153
+ command: "meshctl list"
154
+ capture: agent_list
155
+
156
+ assertions:
157
+ - expr: "${captured.agent_list} contains 'my-agent'"
158
+ message: "Agent should be registered"
159
+
160
+ post_run:
161
+ - handler: shell
162
+ command: "meshctl stop || true"
163
+ workdir: /workspace
164
+ ```
165
+
166
+ ## Documentation
167
+
168
+ Run `tsuite man <topic>` for detailed documentation:
169
+
170
+ | Topic | Description |
171
+ |-------|-------------|
172
+ | quickstart | Getting started guide |
173
+ | suites | Suite structure and config.yaml |
174
+ | testcases | Test case structure and test.yaml |
175
+ | handlers | Built-in handlers (shell, http, file, etc.) |
176
+ | routines | Reusable test routines |
177
+ | assertions | Assertion syntax and expressions |
178
+ | variables | Variable interpolation syntax |
179
+ | docker | Docker mode and container isolation |
180
+ | api | API server and dashboard |
181
+
182
+ See [docs/USER_GUIDE.md](docs/USER_GUIDE.md) for comprehensive documentation.
183
+
184
+ ## Development
185
+
186
+ ```bash
187
+ # Build from source
188
+ make build
189
+
190
+ # Build with dashboard embedded
191
+ make build-with-dashboard
192
+
193
+ # Run tests
194
+ make test
195
+ ```
196
+
197
+ ## License
198
+
199
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpmesh/tsuite",
3
- "version": "0.2.11",
3
+ "version": "0.3.0",
4
4
  "description": "Test suite runner for MCP Mesh",
5
5
  "bin": {
6
6
  "tsuite": "bin/tsuite"
@@ -9,10 +9,10 @@
9
9
  "postinstall": "node scripts/postinstall.js"
10
10
  },
11
11
  "optionalDependencies": {
12
- "@mcpmesh/tsuite-darwin-arm64": "0.2.11",
13
- "@mcpmesh/tsuite-darwin-x64": "0.2.11",
14
- "@mcpmesh/tsuite-linux-arm64": "0.2.11",
15
- "@mcpmesh/tsuite-linux-x64": "0.2.11"
12
+ "@mcpmesh/tsuite-darwin-arm64": "0.3.0",
13
+ "@mcpmesh/tsuite-darwin-x64": "0.3.0",
14
+ "@mcpmesh/tsuite-linux-arm64": "0.3.0",
15
+ "@mcpmesh/tsuite-linux-x64": "0.3.0"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",