Skip to content

Commit

Permalink
Update: Add golang v1.21 to build (#180)
Browse files Browse the repository at this point in the history
* Update: Add golang v1.21 to build

* Update: Align checks with new standard

* Update: Bump cov to v3.2.0
  • Loading branch information
Eric Powers authored Sep 18, 2023
1 parent 90139af commit 3c4160c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 2 additions & 2 deletions context_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
})
Expand Down Expand Up @@ -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)
})
})
Expand Down
4 changes: 2 additions & 2 deletions opentracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ 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)
})
})

Convey("When I call traceRequest on excluded identities", func() {
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)
})
})

Expand Down
4 changes: 2 additions & 2 deletions pubsub_nats_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand All @@ -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)
})
Expand Down
2 changes: 1 addition & 1 deletion websocket_push_session_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3c4160c

Please sign in to comment.