Browse Source

Fix Test Username, Typo in Comment and bug in int to string converting

pull/213/head
MTRNord 8 years ago
parent
commit
e39314124f
No known key found for this signature in database GPG Key ID: E5B89311FAB91B9F
  1. 5
      src/github.com/matrix-org/go-neb/services/circleci/circleci.go
  2. 2
      src/github.com/matrix-org/go-neb/services/circleci/circleci_test.go

5
src/github.com/matrix-org/go-neb/services/circleci/circleci.go

@ -13,9 +13,10 @@ import (
"github.com/matrix-org/go-neb/types"
"github.com/matrix-org/gomatrix"
"io/ioutil"
"strconv"
)
// ServiceType of the Travis-CI service.
// ServiceType of the CircleCI service.
const ServiceType = "circleci"
// DefaultTemplate contains the template that will be used if none is supplied.
@ -89,7 +90,7 @@ func notifToTemplate(n WebhookNotification) map[string]string {
t["repository_slug"] = p.Username + "/" + p.Reponame
t["repository"] = t["repository_slug"] // Deprecated form but still used everywhere in people's templates
t["repository_name"] = p.Reponame
t["build_number"] = string(p.BuildNum)
t["build_number"] = strconv.Itoa(p.BuildNum)
t["build_id"] = t["build_number"] // CircleCI doesn't have a difference between number and ID but to be consistent with TravisCI
t["branch"] = p.Branch
shaLength := len(p.VcsRevision)

2
src/github.com/matrix-org/go-neb/services/circleci/circleci_test.go

@ -120,7 +120,7 @@ func assertResponse(t *testing.T, w *httptest.ResponseRecorder, msgs []gomatrix.
}
func makeService(t *testing.T, template string) *Service {
srv, err := types.CreateService("id", ServiceType, "@travisci:hyrule", []byte(
srv, err := types.CreateService("id", ServiceType, "@circleci:hyrule", []byte(
`{
"rooms":{
"!ewfug483gsfe:localhost": {

Loading…
Cancel
Save