Skip to content

Commit

Permalink
Restructuring the project to temporarily allow test coverage across s…
Browse files Browse the repository at this point in the history
…ingle package.

TODO: find a solution to allow tests to run across multiple packages and aggregate coverage results.
  • Loading branch information
thoeni committed Apr 29, 2017
1 parent 3de5753 commit c8415a2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test:
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
override:
- go test ./... -v -covermode=count -coverprofile=coverage.out
- go test -v -covermode=count -coverprofile=coverage.out
post:
- goveralls -coverprofile=coverage.out -service=circle-ci -repotoken $COVERALLS_REPO_TOKEN

Expand Down
3 changes: 1 addition & 2 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/schema"
"github.com/thoeni/slack-tube-service/service"
"log"
"net/http"
"strings"
)

var tubeService = service.TubeService{tflClient}
var tubeService = TubeService{tflClient}

func lineStatusHandler(w http.ResponseWriter, r *http.Request) {

Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/boltdb/bolt"
"github.com/rs/cors"
"github.com/thoeni/go-tfl"
"github.com/thoeni/slack-tube-service/service"
)

var tokenStore tokenStorer
Expand All @@ -20,7 +19,7 @@ var listenPort = os.Getenv("PORT")

const defaultPort = "1123"

var tflClient = &service.InMemoryCachedClient{
var tflClient = &InMemoryCachedClient{
tfl.NewClient(),
[]tfl.Report{},
time.Now().Add(-121 * time.Second),
Expand Down
2 changes: 1 addition & 1 deletion service/tube-service.go → tube-service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package service
package main

import (
"github.com/thoeni/go-tfl"
Expand Down
2 changes: 1 addition & 1 deletion service/tube-service_test.go → tube-service_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package service
package main

import (
"github.com/golang/mock/gomock"
Expand Down

0 comments on commit c8415a2

Please sign in to comment.