Skip to content

Commit cf4d10c

Browse files
committed
try ci caputure failure
1 parent 50cfe4c commit cf4d10c

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ jobs:
3232
3333
- name: "Step 1: 初始化环境"
3434
run: |
35-
python test_all.py --only-init 2>&1 | tee test_output_1_init.log
36-
- name: "Step 2: build"
35+
python test_all.py --only-init
36+
- name: "Step 2: test test1-build build-test"
3737
run: |
38-
docker exec telego-container go test ./test/test1_build/build_test.go -v 2>&1 | tee test_output_2_build.log
39-
- name: "Step 3: shortcut"
38+
docker exec telego-container go test ./test/test1_build/build_test.go -v
39+
- name: "Step 3: test test2-build-and-run-shortcut shortcut-test"
4040
run: |
41-
docker exec telego-container go test ./test/test2_build_and_run_shortcut/shortcut_test.go -v 2>&1 | tee test_output_3_shortcut.log
42-
- name: "Step 4: config"
41+
docker exec telego-container go test ./test/test2_build_and_run_shortcut/shortcut_test.go -v
42+
- name: "Step 4: test test3-main-node-config config-test"
4343
run: |
44-
docker exec telego-container go test ./test/test3_main_node_config/config_test.go -v 2>&1 | tee test_output_4_config.log
44+
docker exec telego-container go test ./test/test3_main_node_config/config_test.go -v
4545

test/test3_main_node_config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ func TestSSHKeyGeneration(t *testing.T) {
9898
t.Fatalf("SSH 连接 abc 测试失败: %v", err)
9999
}
100100

101-
t.Log("SSH 密钥生成和连接测试成功")
101+
t.Fatalf("SSH 密钥生成和连接测试成功")
102102
}

test_all.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def update_ci_workflow():
345345
test_steps = [
346346
{
347347
"name": "\"Step 1: 初始化环境\"",
348-
"run": "python test_all.py --only-init 2>&1 | tee test_output_1_init.log"
348+
"run": "python test_all.py --only-init" # 2>&1 | tee test_output_1_init.log"
349349
}
350350
]
351351

@@ -354,21 +354,23 @@ def update_ci_workflow():
354354
# 添加直接测试步骤 (根据TESTS["direct"]生成)
355355
if TESTS["direct"]:
356356
for i, test in enumerate(TESTS["direct"]):
357-
test_name = os.path.basename(test).replace("_test.go", "")
357+
# test_name = os.path.basename(test).replace("_test.go", "")
358+
test_name = test.replace("/", "-").replace("_", "-").replace(".go", "")
358359
test_steps.append({
359360
"name": f"\"Step {step_index}: {test_name}\"",
360-
"run": f"go test -v {test} 2>&1 | tee test_output_{step_index}_{test_name}.log",
361+
"run": f"go test -v {test}" # 2>&1 | tee test_output_{step_index}_{test_name}.log",
361362
# "continue-on-error": True
362363
})
363364
step_index += 1
364365

365366
# 添加Docker测试步骤 (根据TESTS["in_docker"]生成)
366367
if TESTS["in_docker"]:
367368
for i, test in enumerate(TESTS["in_docker"]):
368-
test_name = os.path.basename(test).replace("_test.go", "")
369+
# test_name = os.path.basename(test).replace("_test.go", "")
370+
test_name = test.replace("/", " ").replace("_", "-").replace(".go", "")
369371
test_steps.append({
370372
"name": f"\"Step {step_index}: {test_name}\"",
371-
"run": f"docker exec telego-container go test ./{test} -v 2>&1 | tee test_output_{step_index}_{test_name}.log",
373+
"run": f"docker exec telego-container go test ./{test} -v", # 2>&1 | tee test_output_{step_index}_{test_name}.log",
372374
# "continue-on-error": True
373375
})
374376
step_index += 1

0 commit comments

Comments
 (0)