mirror of
https://github.com/consbio/mbtileserver.git
synced 2024-09-19 03:27:16 +03:00
Add travis config and drop unused test
This commit is contained in:
parent
c88b48042f
commit
39b6633876
20
.travis.yml
Normal file
20
.travis.yml
Normal file
@ -0,0 +1,20 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.8
|
||||
- 1.9
|
||||
- tip
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- go: master
|
||||
fast_finish: true
|
||||
|
||||
before_script:
|
||||
- GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
|
||||
- go get github.com/mattn/goveralls
|
||||
|
||||
script:
|
||||
- test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
|
||||
- go test -v -race ./... # Run all the tests with the race detector enabled
|
||||
- go vet ./... # go vet is the official Go static analyzer
|
||||
- $GOPATH/bin/goveralls -service=travis-ci # Run coverage analysis
|
69
main_test.go
69
main_test.go
@ -1,69 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
//
|
||||
"github.com/labstack/echo"
|
||||
//"github.com/labstack/echo/test"
|
||||
//"github.com/stretchr/testify/assert"
|
||||
// "net/http/httptest"
|
||||
//"strings"
|
||||
"net/http/httptest"
|
||||
)
|
||||
|
||||
//
|
||||
//func request(method, path string, e *echo.Echo) (int, string) {
|
||||
// req := test.NewRequest(method, path, nil)
|
||||
// rec := test.NewResponseRecorder()
|
||||
// e.ServeHTTP(req, rec)
|
||||
// return rec.Status(), rec.Body.String()
|
||||
//}
|
||||
|
||||
func TestGetServices(t *testing.T) {
|
||||
//assert := assert.New(t)
|
||||
|
||||
e := echo.New()
|
||||
req := httptest.NewRequest("GET", "/services", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
c := e.NewContext(req, rec)
|
||||
|
||||
//c := e.NewContext(standard.NewRequest(req), standard.NewResponse(rec))
|
||||
|
||||
if err := ListServices(c); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
//assert.NotEqual(1, 0, "should match")
|
||||
|
||||
// Setup
|
||||
//e := echo.New()
|
||||
|
||||
//req, err := http.NewRequest(echo.GET, "/services")
|
||||
//assert.NoError(err)
|
||||
//assert
|
||||
//
|
||||
//
|
||||
|
||||
//r := new(http.Request)
|
||||
//rec := httptest.NewRecorder()
|
||||
//c := e.NewContext(standard.NewRequest(r, e.Logger()), standard.NewResponse(rec, e.Logger()))
|
||||
|
||||
//c, b := request(echo.GET, "/images/walle.png", e)
|
||||
//assert.Equal(t, http.StatusOK, c)
|
||||
//assert.NotEmpty(t, b)
|
||||
//
|
||||
//assert.Equal(e.Routes(), "foo", "should match")
|
||||
|
||||
//c.SetPath("/services")
|
||||
//h := ListServices(c)
|
||||
//assert.Equal(h, http.StatusOK, "Should match")
|
||||
|
||||
//c.SetParamValues("jon@labstack.com")
|
||||
//h := &handler{mockDB}
|
||||
//
|
||||
//// Assertions
|
||||
//if assert.NoError(t, h.getUser(c)) {
|
||||
// assert.Equal(t, http.StatusOK, rec.Code)
|
||||
// assert.Equal(t, "foo:bar", rec.Body.String())
|
||||
//}
|
||||
}
|
Loading…
Reference in New Issue
Block a user