Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
add travis integration build and badges
Browse files Browse the repository at this point in the history
  • Loading branch information
devigned committed Jun 18, 2018
1 parent ef0ff88 commit 4aea0da
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 35 deletions.
41 changes: 23 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
language: go

sudo: false
go:
- 1.9
- 1.10
- tip

matrix:
allow_failures:
- go: top
fast_finish: true

- 1.x
- 1.9.x
before_install:
- go get github.com/golang/lint/golint
- go get github.com/fzipp/gocyclo
- go get github.com/golang/lint/golint
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover

- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- go get github.com/fzipp/gocyclo
- go get github.com/golang/dep/cmd/dep
- go get honnef.co/go/tools/cmd/megacheck
- go get -u golang.org/x/lint/golint
jobs:
include:
- stage: integration tests
if: type IN (push, cron)
env:
- secure: TsDOhh0oWTh5pkpo8YOC9RD20fkC5G228E5z7HlgTaZCIhqr6UOjo/nF4KGGKxCCWzIjC7PcAyEOFf3ZfHZVbMc2RWt+ZoDvnYXTJ1x58ea5r14fswyUdFWpx55DhiaFZNMM6xiB2roFQaFloAUuI5pITknjuslnAXCNXA8ONfNIaBSF842rEfyRV8Jke8pTUe3BpXHg1uRky6HjC1P1hVW3VFmGQ9ODIbxxBD6fKPdznxGLkKmVghIBZ4tqj1e+ysH2Peu+FhwGfxEFXp6WF+K6GIMNheE+P2wn1bDsm+mWwpS5FxcvvcRVEaWCfQf8tf9uXdwGC8sndBmmN2IS5HA5cxuVeBNlVFJOCMaZxSo7NpsRI7jjm0cYFSwegt6ZSKtGw8Lk4ijcz56KyblhBXZoG6mT8NcCXxxsSi3slJHEKHiTqh0UMkXzl5tYAVSS0/WUm+DjxNCb1+zkiwNhBi0rRAkxA3WaY176LWbiftvu9O/chPBWR00Kicr4z95hsafCF908l5Lx31OwgB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6BGJjNMqpWVVOPl4HTFcxTrYza1rmjzVA8XkC3esNBL4IFScHfw=
- secure: HEE7ZrDXItBc0S5iL3tStjFtlpPjLq3ZiF5LRu+s9rr/HmGr+yuD911pUGgqP9+Fvc49520sW7QSkM8bd2GiVN+Fp05DWIl/syQkonFjAxlwg9qzWF4dtFV5n787hkIuqO9W5cRvqe4AEdQ5CdbBpvJ//tVp/DsoFCJKS3VG8gL16vCLmuH+awj0Wk+lnhYHuI6Rce5+W1qSonyQzTWFUaLOQsJw4BYIw9UD0MaZGZjd0xy/93/BW7gKms9f1QGBWCyASaHlPKMS9yUu+rLqm6egfrZf1vL4YufPUlAYLtCvZ1BfEQVLpvAzZPDhK9QGJglgYfkxAZAvw55emvtZQgvLy9LKsNm7YKSdRKjIJsZ+7q76GUew3KT2lqWKK/DXvgd0Q9t+v2jl2n/tEm9Ge0EWOdwRYztNNl+btw/oRGY4CTKwVhSQvYkbkz9h2L5LZ3kRuNfG1ArXHtu/9OdtlUZtEKJ/T21AKEQ7uxyhnvMTXDgH/POXC239Q+YcjHiHTEAPF/pO2qeKcYgRf6LUVrXVjenHgRXIRGWRRs+y7dFzS+0qXM/hCyoXMbJZa3+0srNvN4GjWyodMNuIfvf7xc70pccfyRpaRZr5dM5Ciykm1DALZ7YfWzifNPd/B3ADnooL5JCXDycZi42wIN/9FXXeETBZMAvVrDdu6wcopzI=
script:
- make test-cover
- goveralls -coverprofile=cover.out -service=travis-ci
script:
- make test-cover
- goveralls -coverprofile=cover.out -service=travis-ci
- make
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and Subscriptions.
For more information about Service Bus, check out the [Azure documentation](https://azure.microsoft.com/en-us/services/service-bus/).

This library is a pure Golang implementation of Azure Service Bus over AMQP.
[![Go Report Card](https://goreportcard.com/badge/github.com/Azure/azure-service-bus-go)](https://goreportcard.com/report/github.com/Azure/azure-service-bus-go)
[![godoc](https://godoc.org/github.com/Azure/azure-service-bus-go?status.svg)](https://godoc.org/github.com/Azure/azure-service-bus-go)
[![Build Status](https://travis-ci.org/Azure/azure-service-bus-go.svg?branch=master)](https://travis-ci.org/Azure/azure-service-bus-go)
[![Coverage Status](https://coveralls.io/repos/github/Azure/azure-service-bus-go/badge.svg?branch=master)](https://coveralls.io/github/Azure/azure-service-bus-go?branch=master)


## Preview of Service Bus for Golang
Expand Down
29 changes: 14 additions & 15 deletions mgmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,37 @@ import (

"github.com/Azure/azure-service-bus-go/atom"
"github.com/Azure/go-autorest/autorest/date"
"github.com/stretchr/testify/assert"
)

func (suite *serviceBusSuite) TestFeedUnmarshal() {
var feed atom.Feed
err := xml.Unmarshal([]byte(feedOfQueues), &feed)
assert.Nil(suite.T(), err)
suite.Nil(err)
updated, err := date.ParseTime(time.RFC3339, "2018-05-03T00:21:15Z")
assert.Nil(suite.T(), err)
assert.Equal(suite.T(), "https://sbdjtest.servicebus.windows.net/$Resources/Queues", feed.ID)
assert.Equal(suite.T(), "Queues", feed.Title)
assert.WithinDuration(suite.T(), updated, feed.Updated.ToTime(), 100*time.Millisecond)
assert.Equal(suite.T(), updated, (*feed.Updated).ToTime())
if assert.Len(suite.T(), feed.Entries, 2) {
assert.NotNil(suite.T(), feed.Entries[0].Content)
suite.Nil(err)
suite.Equal("https://sbdjtest.servicebus.windows.net/$Resources/Queues", feed.ID)
suite.Equal("Queues", feed.Title)
suite.WithinDuration(updated, feed.Updated.ToTime(), 100*time.Millisecond)
suite.Equal(updated, (*feed.Updated).ToTime())
if suite.Len(feed.Entries, 2) {
suite.NotNil(feed.Entries[0].Content)
}

}

func (suite *serviceBusSuite) TestEntryUnmarshal() {
var entry atom.Entry
err := xml.Unmarshal([]byte(queueEntry1), &entry)
assert.Nil(suite.T(), err)
assert.Equal(suite.T(), "https://sbdjtest.servicebus.windows.net/foo", entry.ID)
assert.Equal(suite.T(), "foo", entry.Title)
assert.Equal(suite.T(), "sbdjtest", *entry.Author.Name)
assert.Equal(suite.T(), "https://sbdjtest.servicebus.windows.net/foo", entry.Link.HREF)
suite.Nil(err)
suite.Equal("https://sbdjtest.servicebus.windows.net/foo", entry.ID)
suite.Equal("foo", entry.Title)
suite.Equal("sbdjtest", *entry.Author.Name)
suite.Equal("https://sbdjtest.servicebus.windows.net/foo", entry.Link.HREF)
for _, item := range []string{
`<QueueDescription`,
"<LockDuration>PT1M</LockDuration>",
"<MessageCount>0</MessageCount>",
} {
assert.Contains(suite.T(), entry.Content.Body, item)
suite.Contains(entry.Content.Body, item)
}
}
2 changes: 1 addition & 1 deletion namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (ns *Namespace) newConnection() (*amqp.Client, error) {
}

func (ns *Namespace) negotiateClaim(ctx context.Context, conn *amqp.Client, entityPath string) error {
span, ctx := ns.startSpanFromContext(ctx, "eventhub.namespace.negotiateClaim")
span, ctx := ns.startSpanFromContext(ctx, "sb.namespace.negotiateClaim")
defer span.Finish()

audience := ns.getEntityAudience(entityPath)
Expand Down
2 changes: 1 addition & 1 deletion namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestCreateNamespaceFromConnectionString(t *testing.T) {
assert.Contains(t, connStr, ns.Name)
}

func TestServiceBusSuite(t *testing.T) {
func TestSB(t *testing.T) {
suite.Run(t, new(serviceBusSuite))
}

Expand Down

0 comments on commit 4aea0da

Please sign in to comment.