diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8f1ba47..c248d42 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,4 +1,4 @@ -name: CI +name: ci on: push: branches: @@ -21,3 +21,31 @@ jobs: uses: golangci/golangci-lint-action@v3.7.1 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 ./... diff --git a/carrier_test.go b/carrier_test.go index 1b4e0d8..5f1b3ee 100644 --- a/carrier_test.go +++ b/carrier_test.go @@ -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) { @@ -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) {