@sokeai/cli 1.0.84 → 1.0.86

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sokeai/cli",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "description": "授客AI官方CLI工具 - 支持AI Agent Skills",
5
5
  "bin": {
6
6
  "soke-cli": "scripts/run.js"
@@ -11,7 +11,8 @@
11
11
  "release": "./scripts/release.sh"
12
12
  },
13
13
  "files": [
14
- "scripts/",
14
+ "scripts/install.js",
15
+ "scripts/run.js",
15
16
  "skills/"
16
17
  ],
17
18
  "homepage": "https://github.com/sokeai/soke-cli#readme",
@@ -1,109 +0,0 @@
1
- #!/bin/bash
2
-
3
- # 多平台编译脚本
4
- # 用于编译 soke-cli 的所有平台二进制文件
5
-
6
- set -e
7
-
8
- # 颜色输出
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- NC='\033[0m' # No Color
13
-
14
- # 获取版本号
15
- VERSION=$(node -p "require('./package.json').version")
16
- echo -e "${GREEN}开始编译 soke-cli v${VERSION}${NC}"
17
-
18
- HOST_GOOS=$(go env GOOS)
19
- HOST_GOARCH=$(go env GOARCH)
20
-
21
- # 正式发版固定使用正式环境配置
22
- CONFIG_FILE="app.pro.yaml"
23
- if [ ! -f "${CONFIG_FILE}" ]; then
24
- echo -e "${RED}错误: 配置文件不存在: ${CONFIG_FILE}${NC}"
25
- exit 1
26
- fi
27
- CONFIG_BASE64=$(base64 < "${CONFIG_FILE}" | tr -d '\n')
28
- echo -e "${YELLOW}使用配置文件: ${CONFIG_FILE}${NC}"
29
-
30
- # 编译参数
31
- LDFLAGS="-s -w -X soke-cli/internal/version.Version=${VERSION} -X soke-cli/internal/core.EmbeddedConfigBase64=${CONFIG_BASE64}"
32
-
33
- # 创建输出目录
34
- BIN_DIR="bin"
35
- mkdir -p ${BIN_DIR}
36
-
37
- # 清理旧文件
38
- echo -e "${YELLOW}清理旧的编译文件...${NC}"
39
- rm -f ${BIN_DIR}/soke-cli-*
40
-
41
- # 编译函数
42
- build() {
43
- local GOOS=$1
44
- local GOARCH=$2
45
- local OUTPUT=$3
46
-
47
- echo -e "${YELLOW}编译 ${GOOS}-${GOARCH}...${NC}"
48
-
49
- GOOS=${GOOS} GOARCH=${GOARCH} go build \
50
- -ldflags "${LDFLAGS}" \
51
- -o ${BIN_DIR}/${OUTPUT} \
52
- .
53
-
54
- if [ $? -eq 0 ]; then
55
- local SIZE=$(du -h ${BIN_DIR}/${OUTPUT} | cut -f1)
56
- echo -e "${GREEN}✓ ${OUTPUT} (${SIZE})${NC}"
57
-
58
- if [ "${GOOS}" = "${HOST_GOOS}" ] && [ "${GOARCH}" = "${HOST_GOARCH}" ]; then
59
- local BUILT_VERSION=$("${BIN_DIR}/${OUTPUT}" --version | awk '{print $NF}')
60
- if [ "${BUILT_VERSION}" != "${VERSION}" ]; then
61
- echo -e "${RED}✗ ${OUTPUT} 版本校验失败: 期望 ${VERSION}, 实际 ${BUILT_VERSION}${NC}"
62
- exit 1
63
- fi
64
- echo -e "${GREEN}✓ ${OUTPUT} 版本校验通过 (${BUILT_VERSION})${NC}"
65
- fi
66
- else
67
- echo -e "${RED}✗ ${OUTPUT} 编译失败${NC}"
68
- exit 1
69
- fi
70
- }
71
-
72
- # 编译所有平台
73
- echo ""
74
- echo "编译目标平台:"
75
-
76
- # macOS Intel
77
- build "darwin" "amd64" "soke-cli-darwin-amd64"
78
-
79
- # macOS Apple Silicon
80
- build "darwin" "arm64" "soke-cli-darwin-arm64"
81
-
82
- # Linux x64
83
- build "linux" "amd64" "soke-cli-linux-amd64"
84
-
85
- # Linux ARM64 (可选)
86
- # build "linux" "arm64" "soke-cli-linux-arm64"
87
-
88
- # Windows x64
89
- build "windows" "amd64" "soke-cli-windows-amd64.exe"
90
-
91
- echo ""
92
- echo -e "${GREEN}所有平台编译完成!${NC}"
93
- echo ""
94
- echo "编译产物:"
95
- ls -lh ${BIN_DIR}/soke-cli-*
96
-
97
- echo ""
98
- echo -e "${YELLOW}下一步:${NC}"
99
- echo "1. 创建 Git 标签: git tag v${VERSION}"
100
- echo "2. 推送标签: git push origin v${VERSION}"
101
- echo "3. 上传到 GitHub Releases:"
102
- echo " gh release create v${VERSION} \\"
103
- echo " ${BIN_DIR}/soke-cli-darwin-amd64 \\"
104
- echo " ${BIN_DIR}/soke-cli-darwin-arm64 \\"
105
- echo " ${BIN_DIR}/soke-cli-linux-amd64 \\"
106
- echo " ${BIN_DIR}/soke-cli-windows-amd64.exe \\"
107
- echo " --title \"v${VERSION}\" \\"
108
- echo " --notes \"Release v${VERSION}\""
109
- echo "4. 发布到 NPM: npm publish --access public"
@@ -1,381 +0,0 @@
1
- #!/bin/bash
2
-
3
- # soke-cli 端到端测试脚本
4
- # 测试所有命令是否能正常执行
5
- # 支持按模块测试: ./e2e-test.sh [module_name]
6
-
7
- # 注意:不使用 set -e,让所有测试都能运行完
8
-
9
- # 颜色输出
10
- RED='\033[0;31m'
11
- GREEN='\033[0;32m'
12
- YELLOW='\033[1;33m'
13
- BLUE='\033[0;34m'
14
- NC='\033[0m'
15
-
16
- # 测试结果统计
17
- TOTAL_TESTS=0
18
- PASSED_TESTS=0
19
- FAILED_TESTS=0
20
- FAILED_COMMANDS=()
21
-
22
- # 动态时间范围:最近7天(毫秒时间戳)
23
- NOW_MS=$(date +%s)000
24
- SEVEN_DAYS_AGO_MS=$(( ($(date +%s) - 6 * 86400) ))000
25
-
26
- # 获取版本号
27
- VERSION=$(node -p "require('./package.json').version")
28
-
29
- # 获取要测试的模块(如果指定)
30
- TEST_MODULE=$1
31
-
32
- echo -e "${BLUE}========================================${NC}"
33
- if [ -z "$TEST_MODULE" ]; then
34
- echo -e "${BLUE} soke-cli E2E 测试 v${VERSION}${NC}"
35
- else
36
- echo -e "${BLUE} soke-cli E2E 测试 - ${TEST_MODULE} 模块${NC}"
37
- fi
38
- echo -e "${BLUE}========================================${NC}"
39
- echo ""
40
-
41
- # 检查是否已编译
42
- if [ ! -f "./soke-cli" ]; then
43
- echo -e "${YELLOW}未找到编译文件,开始编译...${NC}"
44
- go build -o soke-cli main.go
45
- echo -e "${GREEN}✓ 编译完成${NC}"
46
- echo ""
47
- fi
48
-
49
- # 检查全局安装的 CLI 版本
50
- echo -e "${YELLOW}检查全局 CLI 安装...${NC}"
51
- GLOBAL_CLI=$(which soke-cli 2>/dev/null)
52
- if [ -n "$GLOBAL_CLI" ]; then
53
- echo -e " 全局 CLI 路径: ${BLUE}${GLOBAL_CLI}${NC}"
54
-
55
- # 检查全局版本是否支持 learning-profile
56
- if ! $GLOBAL_CLI learning-profile --help &>/dev/null; then
57
- echo -e "${YELLOW} 警告: 全局 CLI 不支持 learning-profile 模块${NC}"
58
- echo -e "${YELLOW} 需要更新全局安装以支持 skill 测试${NC}"
59
- echo ""
60
- echo -e "${YELLOW}是否要将本地编译版本安装到全局? (y/n)${NC}"
61
- read -r INSTALL_GLOBAL
62
- if [ "$INSTALL_GLOBAL" = "y" ] || [ "$INSTALL_GLOBAL" = "Y" ]; then
63
- echo -e "${YELLOW}安装到全局...${NC}"
64
- sudo cp ./soke-cli $GLOBAL_CLI
65
- echo -e "${GREEN}✓ 全局 CLI 已更新${NC}"
66
- else
67
- echo -e "${YELLOW}跳过全局安装,将仅测试本地版本${NC}"
68
- fi
69
- else
70
- echo -e "${GREEN}✓ 全局 CLI 支持 learning-profile 模块${NC}"
71
- fi
72
- else
73
- echo -e "${YELLOW} 未找到全局 CLI 安装${NC}"
74
- echo -e "${YELLOW} Skill 测试需要全局安装 soke-cli${NC}"
75
- fi
76
- echo ""
77
-
78
- # 检查是否已登录
79
- echo -e "${YELLOW}检查登录状态...${NC}"
80
- if ! ./soke-cli config show &>/dev/null; then
81
- echo -e "${RED}错误: 未配置或未登录${NC}"
82
- echo "请先运行: ./soke-cli config init && ./soke-cli auth login"
83
- exit 1
84
- fi
85
- echo -e "${GREEN}✓ 已登录${NC}"
86
- echo ""
87
-
88
- # 测试函数
89
- test_command() {
90
- local module=$1
91
- local command=$2
92
- local args=$3
93
- local description=$4
94
-
95
- TOTAL_TESTS=$((TOTAL_TESTS + 1))
96
-
97
- echo -n "测试 [$module $command]: $description ... "
98
-
99
- if ./soke-cli $module $command $args &>/dev/null; then
100
- echo -e "${GREEN}✓ 通过${NC}"
101
- PASSED_TESTS=$((PASSED_TESTS + 1))
102
- return 0
103
- else
104
- echo -e "${RED}✗ 失败${NC}"
105
- FAILED_TESTS=$((FAILED_TESTS + 1))
106
- FAILED_COMMANDS+=("$module $command $args")
107
- return 1
108
- fi
109
- }
110
-
111
- # 判断是否应该运行某个模块的测试
112
- should_test_module() {
113
- local module=$1
114
- if [ -z "$TEST_MODULE" ]; then
115
- return 0 # 没有指定模块,测试所有
116
- elif [ "$TEST_MODULE" = "$module" ]; then
117
- return 0 # 指定的模块匹配
118
- else
119
- return 1 # 不匹配,跳过
120
- fi
121
- }
122
-
123
- echo -e "${BLUE}开始测试...${NC}"
124
- echo ""
125
-
126
- # ==================== AI Training 模块 ====================
127
- if should_test_module "ai-training"; then
128
- echo -e "${YELLOW}[AI Training 模块]${NC}"
129
- test_command "ai-training" "+list-packages" "--page 1 --page-size 10" "获取AI教练知识包列表"
130
- test_command "ai-training" "+list-scenarios" "--page 1 --page-size 10" "获取AI陪练场景列表"
131
- test_command "ai-training" "+list-role-avatars" "" "获取AI陪练角色头像列表"
132
- test_command "ai-training" "+list-role-voices" "" "获取AI陪练角色音色列表"
133
- echo ""
134
- fi
135
-
136
- # ==================== Contact 模块 ====================
137
- if should_test_module "contact"; then
138
- echo -e "${YELLOW}[Contact 模块]${NC}"
139
- test_command "contact" "+list-departments" "" "获取部门列表"
140
- test_command "contact" "+get-department" "--dept-id 1" "获取部门详情"
141
- test_command "contact" "+list-department-users" "--dept-id 1" "获取部门用户列表"
142
- test_command "contact" "+list-lectors" "" "获取讲师列表"
143
- test_command "contact" "+list-groups" "--start-time 1672502400000 --end-time 1704038400000" "获取用户组列表"
144
- test_command "contact" "+list-positions" "--page 1 --page-size 10" "获取职位列表"
145
- # 搜索接口暂未授权,跳过
146
- # test_command "contact" "+search-user" "--dept-user-name 测试" "搜索用户"
147
- # test_command "contact" "+search-dept" "--dept-name 测试" "搜索部门"
148
- echo ""
149
- fi
150
-
151
- # ==================== Learning Profile 模块 ====================
152
- if should_test_module "learning-profile"; then
153
- echo -e "${YELLOW}[Learning Profile 模块]${NC}"
154
- test_command "learning-profile" "+list" "--help" "检查学习档案列表命令"
155
- # 学习档案接口暂未授权,跳过
156
- # test_command "learning-profile" "+list" "--offset 0 --page-size 10" "获取学习档案列表"
157
- # test_command "learning-profile" "+list" "--is-new 1 --page-size 5" "获取新员工学习档案"
158
- echo ""
159
- fi
160
-
161
- # ==================== Course 模块 ====================
162
- if should_test_module "course"; then
163
- echo -e "${YELLOW}[Course 模块]${NC}"
164
- test_command "course" "+list-courses" "--page 1 --page-size 10" "获取课程列表"
165
- test_command "course" "+list-categories" "" "获取课程分类"
166
- test_command "course" "+category-tree" "--parent-id 1" "获取课程分类树"
167
- test_command "course" "+search" "--category-id 1" "按分类搜索课程"
168
- test_command "course" "+list-lessons" "--course-id F4025496-6566-4ACD-8CD4-06E3D55BBA79" "获取课程章节"
169
- echo ""
170
- fi
171
-
172
- # ==================== Exam 模块 ====================
173
- if should_test_module "exam"; then
174
- echo -e "${YELLOW}[Exam 模块]${NC}"
175
- test_command "exam" "+list-exams" "--page 1 --page-size 10" "获取考试列表"
176
- test_command "exam" "+list-categories" "" "获取考试分类"
177
- test_command "exam" "+list-pools" "--status 1" "获取题库列表"
178
- test_command "exam" "+list-pool-categories" "" "获取题库分类"
179
- test_command "exam" "+list-papers" "--status 1" "获取试卷列表"
180
- echo ""
181
- fi
182
-
183
- # ==================== Exam Question Pool 模块 ====================
184
- if should_test_module "exam-question-pool"; then
185
- echo -e "${YELLOW}[Exam Question Pool 模块]${NC}"
186
- test_command "exam-question-pool" "+list" "--page 1 --page-size 10" "获取可练习题库列表"
187
- test_command "exam-question-pool" "+get" "--help" "检查题库详情命令"
188
- test_command "exam-question-pool" "+questions" "--help" "检查题库题目命令"
189
- test_command "exam-question-pool" "+finish" "--help" "检查题库交卷命令"
190
- # 详情/题目/交卷接口需要有效题库 UUID,避免在默认 e2e 中硬编码环境数据
191
- # test_command "exam-question-pool" "+get" "--pool-id <pool_uuid>" "获取可练习题库详情"
192
- # test_command "exam-question-pool" "+questions" "--pool-id <pool_uuid>" "获取可练习题库题目"
193
- echo ""
194
- fi
195
-
196
- # ==================== Exam Write 模块 (写操作) ====================
197
- # 创建题库接口服务端故障,暂时跳过写操作测试
198
- if false && should_test_module "exam-write"; then
199
- echo -e "${YELLOW}[Exam Write 模块 - 创建不定项选择题]${NC}"
200
-
201
- # 1. 创建题库
202
- POOL_TITLE="E2E不定项选择题库_$(date +%s)"
203
- echo -n "测试 [exam +create-pool]: 创建题库 ($POOL_TITLE) ... "
204
- CREATE_RESULT=$(./soke-cli exam +create-pool \
205
- --title "$POOL_TITLE" \
206
- --path '["C74A6931-3DEC-4F50-80A2-ECB3FC59127F"]' \
207
- --format json 2>/dev/null)
208
- POOL_UUID=$(echo "$CREATE_RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('uuid',''))" 2>/dev/null)
209
-
210
- if [ -n "$POOL_UUID" ]; then
211
- echo -e "${GREEN}✓ 通过${NC} (uuid: $POOL_UUID)"
212
- PASSED_TESTS=$((PASSED_TESTS + 1))
213
- else
214
- echo -e "${RED}✗ 失败${NC}"
215
- FAILED_TESTS=$((FAILED_TESTS + 1))
216
- FAILED_COMMANDS+=("exam +create-pool --title $POOL_TITLE")
217
- fi
218
- TOTAL_TESTS=$((TOTAL_TESTS + 1))
219
-
220
- # 2. 创建不定项选择题
221
- if [ -n "$POOL_UUID" ]; then
222
- echo -n "测试 [exam +create-question]: 创建不定项选择题 ... "
223
- QUESTION_RESULT=$(./soke-cli exam +create-question \
224
- --title "以下哪些是Go语言的基本数据类型?" \
225
- --type uncertain_choice \
226
- --score 5 \
227
- --difficulty medium \
228
- --pool-id "$POOL_UUID" \
229
- --choices '[{"value":"int","key":"A"},{"value":"float64","key":"B"},{"value":"string","key":"C"},{"value":"char","key":"D"}]' \
230
- --answer '["0","1","2"]' \
231
- --analysis "Go的基本数据类型包括int、float64、string等,没有char类型(使用rune和byte)" \
232
- --format json 2>/dev/null)
233
- QUESTION_CODE=$(echo "$QUESTION_RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('code',''))" 2>/dev/null)
234
- QUESTION_UUID=$(echo "$QUESTION_RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('data',{}).get('uuid',''))" 2>/dev/null)
235
-
236
- if [ "$QUESTION_CODE" = "200" ] && [ -n "$QUESTION_UUID" ]; then
237
- echo -e "${GREEN}✓ 通过${NC} (uuid: $QUESTION_UUID)"
238
- PASSED_TESTS=$((PASSED_TESTS + 1))
239
- else
240
- ERR_MSG=$(echo "$QUESTION_RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('message','')[:80])" 2>/dev/null)
241
- echo -e "${RED}✗ 失败${NC} ($ERR_MSG)"
242
- FAILED_TESTS=$((FAILED_TESTS + 1))
243
- FAILED_COMMANDS+=("exam +create-question --type uncertain_choice")
244
- fi
245
- TOTAL_TESTS=$((TOTAL_TESTS + 1))
246
- fi
247
- echo ""
248
- fi
249
-
250
- # ==================== Certificate 模块 ====================
251
- if should_test_module "certificate"; then
252
- echo -e "${YELLOW}[Certificate 模块]${NC}"
253
- test_command "certificate" "+list" "--page 1 --limit 10" "获取证书列表"
254
- test_command "certificate" "++category" "" "获取证书分类"
255
- echo ""
256
- fi
257
-
258
- # ==================== Credit 模块 ====================
259
- if should_test_module "credit"; then
260
- echo -e "${YELLOW}[Credit 模块]${NC}"
261
- test_command "credit" "+list-logs" "--start-time ${SEVEN_DAYS_AGO_MS} --end-time ${NOW_MS}" "获取学分日志"
262
- echo ""
263
- fi
264
-
265
- # ==================== Point 模块 ====================
266
- if should_test_module "point"; then
267
- echo -e "${YELLOW}[Point 模块]${NC}"
268
- test_command "point" "+list-logs" "--start-time ${SEVEN_DAYS_AGO_MS} --end-time ${NOW_MS}" "获取积分日志"
269
- echo ""
270
- fi
271
-
272
- # ==================== Training 模块 ====================
273
- if should_test_module "training"; then
274
- echo -e "${YELLOW}[Training 模块]${NC}"
275
- test_command "training" "+list-trainings" "--start-time 1672502400000 --end-time 1704038400000" "获取培训列表"
276
- test_command "training" "+list-categories" "" "获取培训分类"
277
- echo ""
278
- fi
279
-
280
- # ==================== Learning Map 模块 ====================
281
- if should_test_module "learning-map"; then
282
- echo -e "${YELLOW}[Learning Map 模块]${NC}"
283
- test_command "learning-map" "+list-maps" "--start-time 1672502400000 --end-time 1704038400000" "获取学习地图列表"
284
- test_command "learning-map" "+list-categories" "" "获取学习地图分类"
285
- echo ""
286
- fi
287
-
288
- # ==================== Photo Gallery 模块 ====================
289
- if should_test_module "photo-gallery"; then
290
- echo -e "${YELLOW}[Photo Gallery 模块]${NC}"
291
- test_command "photo-gallery" "+list-categories" "--page 1 --limit 100" "获取图片库分类列表"
292
- test_command "photo-gallery" "+list" "--page 1 --limit 20" "获取图片库列表"
293
- test_command "photo-gallery" "+get" "--help" "检查图片详情命令"
294
- test_command "photo-gallery" "+create" "--help" "检查图片上传命令"
295
- test_command "photo-gallery" "+batch-delete" "--help" "检查图片批量删除命令"
296
- # 上传/删除为写操作,默认 e2e 不执行
297
- # test_command "photo-gallery" "+get" "--uuid <photo_uuid>" "获取图片详情"
298
- echo ""
299
- fi
300
-
301
- # ==================== Task 模块 ====================
302
- if should_test_module "task"; then
303
- echo -e "${YELLOW}[Task 模块]${NC}"
304
- test_command "task" "+create" "--help" "检查创建异步任务命令"
305
- test_command "task" "+get" "--help" "检查查询异步任务命令"
306
- # +create 会创建异步任务,+get 需要任务 ID;默认 e2e 不执行真实写入
307
- # test_command "task" "+get" "--id <task_id>" "查询异步任务"
308
- echo ""
309
- fi
310
-
311
- # ==================== Training Demand 模块 ====================
312
- if should_test_module "training-demand"; then
313
- echo -e "${YELLOW}[Training Demand 模块]${NC}"
314
- test_command "training-demand" "+list-categories" "" "获取培训需求分类列表"
315
- test_command "training-demand" "+list" "--page 1 --limit 10 --create-time-order desc" "获取培训需求列表"
316
- test_command "training-demand" "+create" "--help" "检查提交培训需求命令"
317
- test_command "training-demand" "+vote" "--help" "检查培训需求投票命令"
318
- # 创建/投票为写操作,默认 e2e 不执行
319
- # test_command "training-demand" "+create" "--title 测试需求 --category-uuid <category_uuid> --level 0" "提交培训需求"
320
- # test_command "training-demand" "+vote" "--uuid <demand_uuid>" "投票培训需求"
321
- echo ""
322
- fi
323
-
324
- # ==================== User 模块 ====================
325
- if should_test_module "user"; then
326
- echo -e "${YELLOW}[User 模块]${NC}"
327
- test_command "user" "+setting" "--name system_setting --cloud-storage 0" "获取用户系统设置"
328
- echo ""
329
- fi
330
-
331
- # ==================== News 模块 ====================
332
- if should_test_module "news"; then
333
- echo -e "${YELLOW}[News 模块]${NC}"
334
- test_command "news" "+list-news" "--help" "检查新闻列表命令"
335
- test_command "news" "+list-categories" "--help" "检查新闻分类命令"
336
- # 新闻接口暂未上线,跳过
337
- # test_command "news" "+list-news" "" "获取新闻列表"
338
- # test_command "news" "+list-categories" "" "获取新闻分类"
339
- echo ""
340
- fi
341
-
342
- # ==================== Clock 模块 ====================
343
- if should_test_module "clock"; then
344
- echo -e "${YELLOW}[Clock 模块]${NC}"
345
- test_command "clock" "list-learnings" "--page 1 --page-size 10" "获取作业列表"
346
- echo ""
347
- fi
348
-
349
- # ==================== File 模块 ====================
350
- if should_test_module "file"; then
351
- echo -e "${YELLOW}[File 模块]${NC}"
352
- test_command "file" "list-files" "" "获取素材库列表"
353
- test_command "file" "list-categories" "" "获取素材库分类"
354
- echo ""
355
- fi
356
-
357
- # ==================== 测试结果汇总 ====================
358
- echo ""
359
- echo -e "${BLUE}========================================${NC}"
360
- echo -e "${BLUE} 测试结果汇总${NC}"
361
- echo -e "${BLUE}========================================${NC}"
362
- echo ""
363
- echo -e "总测试数: ${BLUE}${TOTAL_TESTS}${NC}"
364
- echo -e "通过: ${GREEN}${PASSED_TESTS}${NC}"
365
- echo -e "失败: ${RED}${FAILED_TESTS}${NC}"
366
- echo ""
367
-
368
- if [ ${FAILED_TESTS} -gt 0 ]; then
369
- echo -e "${RED}失败的命令:${NC}"
370
- for cmd in "${FAILED_COMMANDS[@]}"; do
371
- echo -e " ${RED}✗${NC} ./soke-cli $cmd"
372
- done
373
- echo ""
374
- echo -e "${RED}测试失败! 请修复以上问题后再发布。${NC}"
375
- exit 1
376
- else
377
- echo -e "${GREEN}========================================${NC}"
378
- echo -e "${GREEN} 所有测试通过! ✓${NC}"
379
- echo -e "${GREEN}========================================${NC}"
380
- exit 0
381
- fi