sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.63k stars 732 forks source link

Tests for my fork (without any changes!) not working #243

Closed janpieper closed 7 years ago

janpieper commented 7 years ago

I've added a small feature to pgweb and i would like to run all tests before creating a pull request, but I can't get the tests running. Even without any changes to the tests are failing... Would be cool if someone could help.

Official sources

jan@thrudvang ~$ go get github.com/sosedoff/pgweb

jan@thrudvang ~$ cd $GOPATH/src/github.com/sosedoff/pgweb/

jan@thrudvang pgweb (master)$ git rev-parse HEAD
03d3c35a863fe5263f554b80254cd3bf2731e494

jan@thrudvang pgweb (master)$ make dev
go-bindata -o pkg/data/bindata.go -pkg data -debug  -ignore=[.]gitignore -ignore=[.]gitkeep static/...
go build
You can now execute ./pgweb

jan@thrudvang pgweb (master)$ make test

go test -cover ./pkg/...
--- FAIL: Test_assetContentType (0.00s)
        Error Trace:    api_test.go:27
        Error:          Not equal: "application/x-font-woff" (expected)
                                != "application/font-woff" (actual)

        Error Trace:    api_test.go:27
        Error:          Not equal: "application/x-font-ttf" (expected)
                                != "application/font-sfnt" (actual)

FAIL
coverage: 7.1% of statements
FAIL    github.com/sosedoff/pgweb/pkg/api       0.009s
ok      github.com/sosedoff/pgweb/pkg/bookmarks 0.005s  coverage: 97.4% of statements
?       github.com/sosedoff/pgweb/pkg/cli       [no test files]
ok      github.com/sosedoff/pgweb/pkg/client    6.641s  coverage: 50.6% of statements
ok      github.com/sosedoff/pgweb/pkg/command   0.005s  coverage: 64.7% of statements
ok      github.com/sosedoff/pgweb/pkg/connection        0.004s  coverage: 90.0% of statements
?       github.com/sosedoff/pgweb/pkg/data      [no test files]
?       github.com/sosedoff/pgweb/pkg/history   [no test files]
?       github.com/sosedoff/pgweb/pkg/shared    [no test files]
?       github.com/sosedoff/pgweb/pkg/statements        [no test files]
?       github.com/sosedoff/pgweb/pkg/util      [no test files]
Makefile:28: recipe for target 'test' failed
make: *** [test] Error 1

My fork

jan@thrudvang ~$ go get github.com/janpieper/pgweb

jan@thrudvang ~$ cd $GOPATH/src/github.com/janpieper/pgweb/

jan@thrudvang pgweb (master)$ git rev-parse HEAD
03d3c35a863fe5263f554b80254cd3bf2731e494

jan@thrudvang pgweb (master)$ make dev
go-bindata -o pkg/data/bindata.go -pkg data -debug  -ignore=[.]gitignore -ignore=[.]gitkeep static/...
go build
You can now execute ./pgweb

jan@thrudvang pgweb (master)$ make test
go test -cover ./pkg/...
# github.com/janpieper/pgweb/pkg/cli
pkg/cli/cli.go:140: cannot use router (type *"github.com/janpieper/pgweb/vendor/github.com/gin-gonic/gin".Engine) as type *"github.com/sosedoff/pgweb/vendor/github.com/gin-gonic/gin".Engine in argument to api.SetupRoutes
--- FAIL: Test_assetContentType (0.00s)
        Error Trace:    api_test.go:27
        Error:          Not equal: "application/x-font-woff" (expected)
                                != "application/font-woff" (actual)

        Error Trace:    api_test.go:27
        Error:          Not equal: "application/x-font-ttf" (expected)
                                != "application/font-sfnt" (actual)

FAIL
coverage: 7.1% of statements
FAIL    github.com/janpieper/pgweb/pkg/api      0.009s
ok      github.com/janpieper/pgweb/pkg/bookmarks        0.005s  coverage: 97.4% of statements
Makefile:28: recipe for target 'test' failed
make: *** [test] Error 2

Go Env

jan@thrudvang ~$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jan/.go"
GORACE=""
GOROOT="/usr/lib/go-1.8"
GOTOOLDIR="/usr/lib/go-1.8/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="/usr/bin/gcc-4.6"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build397639421=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
sosedoff commented 7 years ago

@janpieper Seems like there was some change related to the x-font-woff mime type in go 1.8.3 (i believe). I was using go 1.8.1 until today and tests were all passing. I pushed a change to master that fixes the problem.

janpieper commented 7 years ago

@sosedoff No, this isn't the problem. I'm not complaining about a failing test. The whole testsuite is crashing (Error 2) without any changes to the code. The x-font-woff test was failing in both cases.

Official sources

FAIL    github.com/sosedoff/pgweb/pkg/api       0.009s
ok      github.com/sosedoff/pgweb/pkg/bookmarks 0.005s  coverage: 97.4% of statements
?       github.com/sosedoff/pgweb/pkg/cli       [no test files]
ok      github.com/sosedoff/pgweb/pkg/client    6.641s  coverage: 50.6% of statements
ok      github.com/sosedoff/pgweb/pkg/command   0.005s  coverage: 64.7% of statements
ok      github.com/sosedoff/pgweb/pkg/connection        0.004s  coverage: 90.0% of statements
?       github.com/sosedoff/pgweb/pkg/data      [no test files]
?       github.com/sosedoff/pgweb/pkg/history   [no test files]
?       github.com/sosedoff/pgweb/pkg/shared    [no test files]
?       github.com/sosedoff/pgweb/pkg/statements        [no test files]
?       github.com/sosedoff/pgweb/pkg/util      [no test files]
Makefile:28: recipe for target 'test' failed
make: *** [test] Error 1

My fork

FAIL    github.com/janpieper/pgweb/pkg/api      0.009s
ok      github.com/janpieper/pgweb/pkg/bookmarks        0.005s  coverage: 97.4% of statements
Makefile:28: recipe for target 'test' failed
make: *** [test] Error 2