Skip to content

Commit

Permalink
feat(ci): test (#5)
Browse files Browse the repository at this point in the history
Signed-off-by: Cattī Crūdēlēs <[email protected]>
  • Loading branch information
wzy9607 authored Feb 9, 2024
1 parent 97e4a29 commit e5f599f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: ci
on:
push:
branches:
Expand All @@ -21,3 +21,31 @@ jobs:
uses: golangci/[email protected]
with:
version: latest
test-coverage:
name: test-coverage
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 'oldstable', 'stable' ]
steps:
- uses: actions/checkout@v4
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Test
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
test-race:
name: test-race
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 'oldstable', 'stable' ]
steps:
- uses: actions/checkout@v4
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Run tests with race detector
run: go test -race ./...
4 changes: 2 additions & 2 deletions carrier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func Test_publishingMessageCarrier_Set(t *testing.T) {
carrier.Set("foo1", "bar2")
carrier.Set("foo2", "bar3")

assert.Equal(t, carrier.msg.Headers, amqp091.Table{"foo": "bar", "foo1": "bar2", "foo2": "bar3"})
assert.Equal(t, amqp091.Table{"foo": "bar", "foo1": "bar2", "foo2": "bar3"}, carrier.msg.Headers)
}

func Test_publishingMessageCarrier_Keys(t *testing.T) {
Expand Down Expand Up @@ -158,7 +158,7 @@ func Test_deliveryMessageCarrier_Set(t *testing.T) {
carrier.Set("foo1", "bar2")
carrier.Set("foo2", "bar3")

assert.Equal(t, carrier.msg.Headers, amqp091.Table{"foo": "bar", "foo1": "bar2", "foo2": "bar3"})
assert.Equal(t, amqp091.Table{"foo": "bar", "foo1": "bar2", "foo2": "bar3"}, carrier.msg.Headers)
}

func Test_deliveryMessageCarrier_Keys(t *testing.T) {
Expand Down

0 comments on commit e5f599f

Please sign in to comment.