统一单入口 Go 工程与前端依赖目录,增加后台供应商配置、候选审核、计划预算、成交冲正、持仓复盘和站内通知。接入策略版本、Python 回测、可配置 A 股公开行情及 zap 文件轮转日志,补充迁移、契约与验证。
This commit is contained in:
@@ -3,8 +3,7 @@ package handler
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"log/slog"
|
||||
"go.uber.org/zap"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
@@ -16,7 +15,7 @@ import (
|
||||
func TestLivenessAndReadinessAreIndependent(t *testing.T) {
|
||||
secretError := "password=secret-internal-detail"
|
||||
health := service.NewHealthService(nil, func(context.Context) error { return errors.New(secretError) })
|
||||
router := NewRouter(health, slog.New(slog.NewTextHandler(io.Discard, nil)), IdentityOptions{})
|
||||
router := NewRouter(health, zap.NewNop(), IdentityOptions{})
|
||||
for _, tc := range []struct {
|
||||
path string
|
||||
status int
|
||||
@@ -37,7 +36,7 @@ func TestLivenessAndReadinessAreIndependent(t *testing.T) {
|
||||
|
||||
func TestReadyWhenBothDependenciesRespond(t *testing.T) {
|
||||
probe := func(context.Context) error { return nil }
|
||||
router := NewRouter(service.NewHealthService(probe, probe), slog.New(slog.NewTextHandler(io.Discard, nil)), IdentityOptions{})
|
||||
router := NewRouter(service.NewHealthService(probe, probe), zap.NewNop(), IdentityOptions{})
|
||||
rec := httptest.NewRecorder()
|
||||
router.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/readyz", nil))
|
||||
if rec.Code != http.StatusOK {
|
||||
@@ -47,7 +46,7 @@ func TestReadyWhenBothDependenciesRespond(t *testing.T) {
|
||||
|
||||
func TestEmbeddedConsoleAndAPIBoundary(t *testing.T) {
|
||||
probe := func(context.Context) error { return nil }
|
||||
router := NewRouter(service.NewHealthService(probe, probe), slog.New(slog.NewTextHandler(io.Discard, nil)), IdentityOptions{})
|
||||
router := NewRouter(service.NewHealthService(probe, probe), zap.NewNop(), IdentityOptions{})
|
||||
for _, path := range []string{"/", "/research/candidates"} {
|
||||
rec := httptest.NewRecorder()
|
||||
router.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, path, nil))
|
||||
|
||||
Reference in New Issue
Block a user