Skip to content

Commit 598d893

Browse files
committed
ci(workflow): 更新测试工作流以支持回调处理测试
ci(workflow): update test workflow to support callback handler testing
1 parent e492909 commit 598d893

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/go-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Go Build and Test
1+
name: Go Callback Handler Test
22

33
on:
44
push:
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Run integration test
4646
run: |
47-
# Start the application in the background
47+
# Start the callback handler application in the background
4848
nohup ./myapp > app.log 2>&1 &
4949
5050
# Health check - wait for the server to be ready (max 30 seconds)
@@ -57,7 +57,7 @@ jobs:
5757
sleep 1
5858
done
5959
60-
# Prepare and send API request
60+
# Prepare and send a simulated external callback (POST request)
6161
SIGNATURE=$(echo -n '{"args":[]}' | openssl dgst -sha256 -hmac "my-test-secret" | sed 's/^.* //')
6262
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST http://localhost:8080/backup \
6363
-H "Content-Type: application/json" \
@@ -81,7 +81,7 @@ jobs:
8181
exit 1
8282
fi
8383
84-
echo "Integration test passed"
84+
echo "Callback handler test passed"
8585
8686
# Cleanup
8787
killall myapp || true

go/callback/internal/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Config struct {
1111
Port string
1212
ScriptPath string
1313
CallbackSecret string
14+
CallbackURL string // 新增字段用于存储回调URL
1415
}
1516

1617
// LoadConfig 从指定路径读取配置文件并返回配置对象

0 commit comments

Comments
 (0)