gonum/plot

Tests failing: wrong path in assertion

Deleplace opened this issue · 7 comments

What are you trying to do?

Checkout Gonum, run all the tests

What did you do?

$ sudo apt-get install libxkbcommon-x11-dev
$ go test ./...

What did you expect to happen?

OK

What actually happened?

$ go test ./...
...
?   	gonum.org/v1/plot/vg/fonts	[no test files]
--- FAIL: TestRecorder (0.00s)
    recorder_test.go:47: unexpected action:
        	got: "/home/deleplace/git/gonum/plot/vg/recorder/recorder_test.go:26 Stroke(vg.Path{vg.PathComp{Type:0, Pos:vg.Point{X:3, Y:4}, Control:[]vg.Point(nil), Radius:0, Start:0, Angle:0}})"
        	want: "gonum.org/v1/plot/vg/recorder/recorder_test.go:26 Stroke(vg.Path{vg.PathComp{Type:0, Pos:vg.Point{X:3, Y:4}, Control:[]vg.Point(nil), Radius:0, Start:0, Angle:0}})"
    recorder_test.go:47: unexpected action:
        	got: "/home/deleplace/git/gonum/plot/vg/recorder/recorder_test.go:27 Push()"
        	want: "gonum.org/v1/plot/vg/recorder/recorder_test.go:27 Push()"
    recorder_test.go:47: unexpected action:
        	got: "/home/deleplace/git/gonum/plot/vg/recorder/recorder_test.go:28 Pop()"
        	want: "gonum.org/v1/plot/vg/recorder/recorder_test.go:28 Pop()"
    recorder_test.go:47: unexpected action:
        	got: "/home/deleplace/git/gonum/plot/vg/recorder/recorder_test.go:29 Translate(3, 4)"
        	want: "gonum.org/v1/plot/vg/recorder/recorder_test.go:29 Translate(3, 4)"
FAIL
...

What version of Go and Gonum/plot are you using?

$ go version
go version go1.16 linux/amd64
$ git rev-parse HEAD
caab7788e04dfd7a74cec4ee80f55b7d1f9a2bfa

This is Gonum v0.9.0

Does this issue reproduce with the current master?

Yes

I checked out Gonum in a folder outside of GOPATH. I don't have the env var GO111MODULE set.

I'll see if I can fix this and make a PR.

I'm not sure that we want to fix this; we don't support GOPATH build environments (if they work that's great, but they are no longer a target).

I'm not in a GOPATH build environment. In Go 1.16, modules are the default, without env vars.

Oh. OK, let me have a look. ... I cannot get that test to fail locally and it does not fail on CI. Can you show me the output of go env?

$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/deleplace/.cache/go-build"
GOENV="/home/deleplace/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/deleplace/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/deleplace/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/deleplace/git/gonum/plot/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build206568871=/tmp/go-build -gno-record-gcc-switches"

I fetched Gonum via git clone, so it's not ended up inside of a gonum.org/v1 folder. It is my understanding that this is not supposed to prevent the tests from succeeding. I might me wrong though.

That is the cause of the failure. The build system expects that things live in their correct places and this was previously (prior to modules) checked via import comments (in that situation the package would not even build let alone fail). Please rename your path prefix from gonum/plot to gonum.org/v1/plot.