From e39314124fa805d86f1fa8b15f0e4a12c98b7b56 Mon Sep 17 00:00:00 2001 From: MTRNord Date: Tue, 12 Dec 2017 16:19:57 +0100 Subject: [PATCH] Fix Test Username, Typo in Comment and bug in int to string converting --- .../matrix-org/go-neb/services/circleci/circleci.go | 5 +++-- .../matrix-org/go-neb/services/circleci/circleci_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/github.com/matrix-org/go-neb/services/circleci/circleci.go b/src/github.com/matrix-org/go-neb/services/circleci/circleci.go index a0f3c7d..4b69610 100644 --- a/src/github.com/matrix-org/go-neb/services/circleci/circleci.go +++ b/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) diff --git a/src/github.com/matrix-org/go-neb/services/circleci/circleci_test.go b/src/github.com/matrix-org/go-neb/services/circleci/circleci_test.go index 453f49e..14b9f37 100644 --- a/src/github.com/matrix-org/go-neb/services/circleci/circleci_test.go +++ b/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": {