diff --git a/.github/workflows/build-go.yaml b/.github/workflows/build-go.yaml index 3db7bb0..349fd10 100644 --- a/.github/workflows/build-go.yaml +++ b/.github/workflows/build-go.yaml @@ -20,10 +20,11 @@ jobs: matrix: go: - "1.20" + - "1.21" steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} cache: true @@ -36,7 +37,7 @@ jobs: run: | make - - uses: PaloAltoNetworks/cov@3.0.0 + - uses: PaloAltoNetworks/cov@3.2.0 with: main_branch: master cov_file: unit_coverage.out diff --git a/.github/workflows/cov.yaml b/.github/workflows/cov.yaml index 47db9a7..158a3e3 100644 --- a/.github/workflows/cov.yaml +++ b/.github/workflows/cov.yaml @@ -10,7 +10,7 @@ jobs: cov: runs-on: ubuntu-latest steps: - - uses: PaloAltoNetworks/cov@3.0.0 + - uses: PaloAltoNetworks/cov@3.2.0 with: cov_mode: send-status workflow_run_id: ${{github.event.workflow_run.id}} diff --git a/context_mock_test.go b/context_mock_test.go index 084c0da..daa4290 100644 --- a/context_mock_test.go +++ b/context_mock_test.go @@ -28,7 +28,7 @@ func TestMockContext_NewMockContext(t *testing.T) { c := NewMockContext(context.Background()) Convey("Then it should be correctly initialized", func() { - So(c.MockCtx, ShouldEqual, context.Background()) + So(c.MockCtx, ShouldResemble, context.Background()) So(c.Metadata("hello"), ShouldBeNil) So(c, ShouldImplement, (*Context)(nil)) }) @@ -100,7 +100,7 @@ func TestMockContext_Duplicate(t *testing.T) { ctx2 := ctx.Duplicate() Convey("Then the duplicated context should be correct", func() { - So(ctx.MockCtx, ShouldEqual, ctx2.Context()) + So(ctx.MockCtx, ShouldResemble, ctx2.Context()) So(ctx.MockCount, ShouldEqual, ctx2.Count()) So(ctx.Metadata("hello").(string), ShouldEqual, "world") So(ctx.MockInputData, ShouldEqual, ctx2.InputData()) diff --git a/context_test.go b/context_test.go index 132866e..20a67ab 100644 --- a/context_test.go +++ b/context_test.go @@ -40,7 +40,7 @@ func TestContext_NewContext(t *testing.T) { So(c.request.Page, ShouldEqual, 1) So(c.request.PageSize, ShouldEqual, 10) - So(c.ctx, ShouldEqual, context.Background()) + So(c.ctx, ShouldResemble, context.Background()) So(c, ShouldImplement, (*Context)(nil)) }) }) @@ -68,7 +68,7 @@ func TestContext_NewContext(t *testing.T) { So(c.Request().Page, ShouldEqual, 1) So(c.Request().PageSize, ShouldEqual, 10) - So(c.Context(), ShouldEqual, context.Background()) + So(c.Context(), ShouldResemble, context.Background()) So(c.Metadata("hello"), ShouldBeNil) }) }) diff --git a/opentracing_test.go b/opentracing_test.go index bd4bd72..78b80e7 100644 --- a/opentracing_test.go +++ b/opentracing_test.go @@ -222,7 +222,7 @@ func TestTracing_traceRequest(t *testing.T) { tctx := traceRequest(ctx, req, nil, nil, nil) Convey("Then the returned context should should be the same", func() { - So(tctx, ShouldEqual, ctx) + So(tctx, ShouldResemble, ctx) }) }) @@ -230,7 +230,7 @@ func TestTracing_traceRequest(t *testing.T) { tctx := traceRequest(ctx, req, tracer, map[string]struct{}{"user": {}}, nil) Convey("Then the returned context should should be the same", func() { - So(tctx, ShouldEqual, ctx) + So(tctx, ShouldResemble, ctx) }) }) diff --git a/pubsub_nats_options_test.go b/pubsub_nats_options_test.go index eec1eb7..bf8966a 100644 --- a/pubsub_nats_options_test.go +++ b/pubsub_nats_options_test.go @@ -79,7 +79,7 @@ func TestBahamut_PubSubNatsOptionsPublish(t *testing.T) { Convey("Calling NATSOptPublishRequireAck should work", func() { NATSOptPublishRequireAck(context.TODO())(&c) - So(c.ctx, ShouldEqual, context.TODO()) + So(c.ctx, ShouldResemble, context.TODO()) So(c.desiredResponse, ShouldEqual, ResponseModeACK) }) @@ -100,7 +100,7 @@ func TestBahamut_PubSubNatsOptionsPublish(t *testing.T) { Convey("Calling NATSOptRespondToChannel should work", func() { respCh := make(chan *Publication) NATSOptRespondToChannel(context.TODO(), respCh)(&c) - So(c.ctx, ShouldEqual, context.TODO()) + So(c.ctx, ShouldResemble, context.TODO()) So(c.responseCh, ShouldEqual, respCh) So(c.desiredResponse, ShouldEqual, ResponseModePublication) }) diff --git a/websocket_push_session_mock_test.go b/websocket_push_session_mock_test.go index b7e1bd7..2e51765 100644 --- a/websocket_push_session_mock_test.go +++ b/websocket_push_session_mock_test.go @@ -45,7 +45,7 @@ func TestMockSession(t *testing.T) { So(s.Token(), ShouldEqual, "token") So(s.TLSConnectionState(), ShouldNotBeNil) So(s.Metadata(), ShouldEqual, "mischief") - So(s.Context(), ShouldEqual, context.Background()) + So(s.Context(), ShouldResemble, context.Background()) So(s.ClientIP(), ShouldEqual, "1.1.1.1") cc, err := s.Cookie("c")