From 7d7a523f2ad45309ca1090c6719ff0e3a6499e0b Mon Sep 17 00:00:00 2001 From: "yinxuran.lucky" Date: Sun, 28 Jul 2024 21:28:51 +0800 Subject: [PATCH] feat: update ci --- go.mod | 2 +- go.sum | 4 ++-- pkg/app/client/option_test.go | 2 -- pkg/app/server/hertz_test.go | 10 +++++----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 70dd3521e..6bf4bf9a2 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/bytedance/go-tagexpr/v2 v2.9.2 github.com/bytedance/gopkg v0.0.0-20240507064146-197ded923ae3 - github.com/bytedance/mockey v1.2.1 + github.com/bytedance/mockey v1.2.10 github.com/bytedance/sonic v1.11.9 github.com/cloudwego/netpoll v0.6.2 github.com/fsnotify/fsnotify v1.5.4 diff --git a/go.sum b/go.sum index f27d7259c..40eecc656 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/bytedance/go-tagexpr/v2 v2.9.2 h1:QySJaAIQgOEDQBLS3x9BxOWrnhqu5sQ+f6H github.com/bytedance/go-tagexpr/v2 v2.9.2/go.mod h1:5qsx05dYOiUXOUgnQ7w3Oz8BYs2qtM/bJokdLb79wRM= github.com/bytedance/gopkg v0.0.0-20240507064146-197ded923ae3 h1:ZKUHguI38SRQJkq7hhmwn8lAv3xM6B5qkj1IneS15YY= github.com/bytedance/gopkg v0.0.0-20240507064146-197ded923ae3/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ= -github.com/bytedance/mockey v1.2.1 h1:g84ngI88hz1DR4wZTL3yOuqlEcq67MretBfQUdXwrmw= -github.com/bytedance/mockey v1.2.1/go.mod h1:+Jm/fzWZAuhEDrPXVjDf/jLM2BlLXJkwk94zf2JZ3X4= +github.com/bytedance/mockey v1.2.10 h1:4JlMpkm7HMXmTUtItid+iCu2tm61wvq+ca1X2u7ymzE= +github.com/bytedance/mockey v1.2.10/go.mod h1:bNrUnI1u7+pAc0TYDgPATM+wF2yzHxmNH+iDXg4AOCU= github.com/bytedance/sonic v1.11.9 h1:LFHENlIY/SLzDWverzdOvgMztTxcfcF+cqNsz9pK5zg= github.com/bytedance/sonic v1.11.9/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= diff --git a/pkg/app/client/option_test.go b/pkg/app/client/option_test.go index f744210c9..3b5af7183 100644 --- a/pkg/app/client/option_test.go +++ b/pkg/app/client/option_test.go @@ -17,7 +17,6 @@ package client import ( - "fmt" "testing" "time" @@ -60,5 +59,4 @@ func TestClientOptions(t *testing.T) { assert.DeepEqual(t, 5*time.Second, opt.RetryConfig.MaxDelay) assert.DeepEqual(t, 1*time.Second, opt.RetryConfig.MaxJitter) assert.DeepEqual(t, 1*time.Second, opt.ObservationInterval) - assert.DeepEqual(t, fmt.Sprint(retry.CombineDelay(retry.FixedDelayPolicy, retry.BackOffDelayPolicy, retry.RandomDelayPolicy)), fmt.Sprint(opt.RetryConfig.DelayPolicy)) } diff --git a/pkg/app/server/hertz_test.go b/pkg/app/server/hertz_test.go index 3352d34c8..d20db2f96 100644 --- a/pkg/app/server/hertz_test.go +++ b/pkg/app/server/hertz_test.go @@ -218,28 +218,28 @@ func Test_getServerName(t *testing.T) { } func TestServer_Run(t *testing.T) { - hertz := New(WithHostPorts("127.0.0.1:8888")) + hertz := New(WithHostPorts("127.0.0.1:8899")) hertz.GET("/test", func(c context.Context, ctx *app.RequestContext) { path := ctx.Request.URI().PathOriginal() ctx.SetBodyString(string(path)) }) hertz.POST("/redirect", func(c context.Context, ctx *app.RequestContext) { - ctx.Redirect(consts.StatusMovedPermanently, []byte("http://127.0.0.1:8888/test")) + ctx.Redirect(consts.StatusMovedPermanently, []byte("http://127.0.0.1:8899/test")) }) go hertz.Run() time.Sleep(100 * time.Microsecond) - resp, err := http.Get("http://127.0.0.1:8888/test") + resp, err := http.Get("http://127.0.0.1:8899/test") assert.Nil(t, err) assert.DeepEqual(t, consts.StatusOK, resp.StatusCode) b := make([]byte, 5) resp.Body.Read(b) assert.DeepEqual(t, "/test", string(b)) - resp, err = http.Get("http://127.0.0.1:8888/foo") + resp, err = http.Get("http://127.0.0.1:8899/foo") assert.Nil(t, err) assert.DeepEqual(t, consts.StatusNotFound, resp.StatusCode) - resp, err = http.Post("http://127.0.0.1:8888/redirect", "", nil) + resp, err = http.Post("http://127.0.0.1:8899/redirect", "", nil) assert.Nil(t, err) assert.DeepEqual(t, consts.StatusOK, resp.StatusCode) b = make([]byte, 5)